3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A{ function x() {} } class B extends A{ function x() { parent::__METHOD__(); } } $o = new B; $o->x();
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
Fatal error: Uncaught Error: Call to undefined method A::__METHOD__() in /in/acA6c:10 Stack trace: #0 /in/acA6c(15): B->x() #1 {main} thrown in /in/acA6c on line 10
Process exited with code 255.
Output for 5.5.0 - 5.5.36, 5.6.0 - 5.6.28
Parse error: syntax error, unexpected '__METHOD__' (T_METHOD_C) in /in/acA6c on line 10
Process exited with code 255.
Output for 5.4.0 - 5.4.45
Parse error: syntax error, unexpected '__METHOD__' (T_METHOD_C), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in /in/acA6c on line 10
Process exited with code 255.
Output for 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29
Parse error: syntax error, unexpected T_METHOD_C, expecting T_STRING or T_VARIABLE or '$' in /in/acA6c on line 10
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_METHOD_C, expecting T_STRING or T_VARIABLE or '$' in /in/acA6c on line 10
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined method: b->__method__() in /in/acA6c on line 10
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.4
Fatal error: Call to undefined function: __method__() in /in/acA6c on line 10
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: __method__() in /in/acA6c on line 10

preferences:
296.85 ms | 401 KiB | 386 Q