3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A { function ech() { echo 'aaa'; } } class B extends A {} class C extends B { function new() { $this->ech(); } } $a new C(); $a->new();
based on Kdibs
Output for 7.0.0
Parse error: syntax error, unexpected 'new' (T_NEW) in /in/H7m1I on line 14
Process exited with code 255.
Output for 5.4.10 - 5.6.16
Parse error: syntax error, unexpected 'new' (T_NEW), expecting identifier (T_STRING) in /in/H7m1I on line 9
Process exited with code 255.
Output for 5.3.20 - 5.3.29
Parse error: syntax error, unexpected T_NEW, expecting T_STRING in /in/H7m1I on line 9
Process exited with code 255.