3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private function __call($name, $args) { echo $name; } protected foo() { echo 'ahoj'; } } class B extends A { } $a = new B; $a->d();
Output for 5.4.0 - 5.4.25
Warning: The magic method __call() must have public visibility and cannot be static in /in/TcrEt on line 3 Parse error: syntax error, unexpected 'foo' (T_STRING), expecting variable (T_VARIABLE) in /in/TcrEt on line 7
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Warning: The magic method __call() must have public visibility and cannot be static in /in/TcrEt on line 3 Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE in /in/TcrEt on line 7
Process exited with code 255.

preferences:
202.51 ms | 1395 KiB | 62 Q