I’m just new in PHP and using PHP 5.3.13, I’m struggle with overload in php.
I write tiny code to verify _call is triggered but it simply doesn’t work.
Anyone have any idea?
class Foo{
function _call($methodName, $argument){
echo "_call()";
}
}
$foo = new Foo;
$foo->runtest();
Error: Fatal error: Call to undefined method Foo::runtest() in
C:\wamp\www\tutorial\part2\testfunctions.php on line 77
Thanks u very much
You have a typo, it takes two underscores to __call.