I want to be able to create methods within __construct
I tried using lambda in the following way
// This is what I am trying to achieve as an end result
class A extends Z{
public function __construct() {
parent::__construct()
}
public function myfunc() { // do something }
}
// This was an attempt to implement it
class A extends Z{
public function __construct() {
//example
if ($something_is_true) {
$this->myfunc = function () {}
}
parent::__construct()
}
}
I hope this explains what I am trying to achieve
EDIT
I have URLs mapped to functions, and I want to have some logic to determine what URL-mapped-functions exist on the class