<?php
class x {
public static function foo() {
print "foo";
}
function bar() {
$x = array(get_class(), "foo");
call_user_func($x);
$x();
}
}
$a = new x;
$a->bar();
?>
foo
Fatal error: Function name must be a string in /in/iYJTY on line 9
Process exited with code 255.
Output for 5.1.2
Strict Standards: Non-static method x::foo() cannot be called statically, assuming $this from compatible context x in /in/iYJTY on line 8
foo
Fatal error: Function name must be a string in /in/iYJTY on line 9
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/iYJTY on line 3
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/iYJTY on line 3
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/iYJTY on line 3
Process exited with code 255.