<?php
class Bar {
function foobar() { echo 'test'; }
}
class Foo {
public $bar;
public function __call($method, $args) {
call_user_func_array(array($this->bar, $method), $args);
}
}
$foo = new Foo;
$foo->bar = new Bar;
var_dump(method_exists($foo, 'bar'));
var_dump(is_callable(array($foo, 'bar')));
var_dump(is_callable(array($foo, 'bar2')));
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/dLc1E on line 8
Process exited with code 255.
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/dLc1E on line 8
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/dLc1E on line 8
Process exited with code 255.