3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php new class(self::foo('foo')) { // Never invoked. private static function foo($foo) { var_dump($foo); } };
based on mUVrN
Output for 7.1.0 - 7.3.0beta1
Fatal error: Uncaught Error: Cannot access self:: when no class scope is active in /in/8Hl4s:3 Stack trace: #0 {main} thrown in /in/8Hl4s on line 3
Process exited with code 255.
Output for 7.0.0 - 7.0.20
Output for hhvm-3.15.4
Fatal error: Uncaught Error: Cannot access self:: when no class scope is active in /in/8Hl4s:3 Stack trace: #0 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
Parse error: syntax error, unexpected 'class' (T_CLASS) in /in/8Hl4s on line 3
Process exited with code 255.