3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class A1 { public function __call($method, $args) { echo "__call"; } public static function __callStatic($method, $args) { echo "__callStatic"; } } class A2 { // A1 with private function test public function __call($method, $args) { echo "__call"; } public static function __callStatic($method, $args) { echo "__callStatic"; } private function test() {} } class B1 extends A1 { public function test(){ parent::test(); } } class B2 extends A2 { public function test(){ parent::test(); } } $test1 = new B1; $test2 = new B2; $test1->test(); $test2->test();
Output for 5.3.0 - 5.3.2, 5.3.4 - 7.1.0
__call__callStatic
Output for 5.3.3
__callStatic__callStatic
Output for 5.2.6 - 5.2.17
__call Fatal error: Call to private method A2::test() from context 'B2' in /in/OQe9n on line 18
Process exited with code 255.
Output for 5.0.0 - 5.2.5
Fatal error: Call to undefined method A1::test() in /in/OQe9n on line 14
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/OQe9n on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/OQe9n 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/OQe9n on line 3
Process exited with code 255.