3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class My_Class { const CLASS_CONSTANT = 'test value'; public static function my_function() { $lambda_function = function() { echo self::CLASS_CONSTANT; }; $lambda_function(); } public static function start() { self::my_function(); } } MyClass::start();
based on 3Y861
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Class 'MyClass' not found in /in/ZcsjW:19 Stack trace: #0 {main} thrown in /in/ZcsjW on line 19
Process exited with code 255.
Output for 5.3.19 - 5.6.28
Fatal error: Class 'MyClass' not found in /in/ZcsjW on line 19
Process exited with code 255.