3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class B { } class D { public function m() { return new parent(); } } var_dump((new D)::m());
based on QU0LF
Output for 7.0.0 - 7.3.0alpha1
Deprecated: Non-static method D::m() should not be called statically in /in/cUvOI on line 11 Fatal error: Uncaught Error: Cannot access parent:: when current class scope has no parent in /in/cUvOI:7 Stack trace: #0 /in/cUvOI(11): D::m() #1 {main} thrown in /in/cUvOI on line 7
Process exited with code 255.
Output for 5.4.0 - 5.6.28
Parse error: syntax error, unexpected '::' (T_PAAMAYIM_NEKUDOTAYIM) in /in/cUvOI on line 11
Process exited with code 255.
Output for 5.3.19 - 5.3.29
Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM in /in/cUvOI on line 11
Process exited with code 255.