3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class TestA { const TEST = 'a'; public static function test() { echo static::TEST; } } class TestB { const TEST = 'b'; } $test = new TestA(); $test2 = new testB(); echo $test; echo $test2;
based on hqvpu
Output for 7.1.0 - 7.2.11
Recoverable fatal error: Object of class TestA could not be converted to string in /in/hRQDL on line 19
Process exited with code 255.
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.0.31
Catchable fatal error: Object of class TestA could not be converted to string in /in/hRQDL on line 19
Process exited with code 255.
Output for hhvm-3.22.0
Fatal error: Uncaught Error: Object of class TestA could not be converted to string in /in/hRQDL:-1 Stack trace: #0 {main}
Process exited with code 255.
Output for hhvm-3.15.4 - 3.21.3
Fatal error: Uncaught Error: Object of class TestA could not be converted to string in /in/hRQDL:19 Stack trace: #0 {main}
Process exited with code 255.