Is there a magic method when, when a certain method is called from an object, the magic method is first called. Kinda as the __call method, but this only works when the method is not found.
So, in my case, I would like something like this:
class MyClass
{
public function __startMethod ( $method, $args )
{
echo ' [start] ';
}
public function helloWorld ( )
{
echo ' [Hello] ';
}
}
$obj = new MyClass();
$obj->helloWorld();
[start] [Hello]
Is there something similar in PHP?
source
share