3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class demo{ public static $demo = "static.demo"; const $a=6; public static function mydemo(){ echo "static.mydemo"; } } $a = new demo(); echo $a::$demo;//版本的问题吧php 5.2.17报错 echo demo::$demo;demo::mydemo();echo demo::$a;
Output for 5.4.0 - 5.4.24
Parse error: syntax error, unexpected '$a' (T_VARIABLE), expecting identifier (T_STRING) in /in/bpsS5 on line 4
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_VARIABLE, expecting T_STRING in /in/bpsS5 on line 4
Process exited with code 255.