3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Test { const COUNTRY_test = 'test'; public function Test($var = 'COUNTRY_test') { echo self::$var; } } $test = new Test();
Output for 7.0.0 - 7.2.0
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Test has a deprecated constructor in /in/nhOej on line 3 Fatal error: Uncaught Error: Access to undeclared static property: Test::$var in /in/nhOej:9 Stack trace: #0 /in/nhOej(13): Test->Test() #1 {main} thrown in /in/nhOej on line 9
Process exited with code 255.
Output for 5.3.18 - 5.6.28
Fatal error: Access to undeclared static property: Test::$var in /in/nhOej on line 9
Process exited with code 255.