3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A { public const CPUB = 'PUB'; protected const CPRO = 'PRO'; private const CPRI = 'PRI'; public $pub = 'pub'; protected $pro = 'pro'; private $pri = 'pri'; } var_dump((array) new A);
based on f0lUv
Output for 7.1.0 - 7.3.0rc3
array(3) { ["pub"]=> string(3) "pub" ["*pro"]=> string(3) "pro" ["Apri"]=> string(3) "pri" }
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.0.20
Parse error: syntax error, unexpected 'const' (T_CONST), expecting variable (T_VARIABLE) in /in/7a1KE on line 5
Process exited with code 255.
Output for hhvm-3.15.4
Fatal error: Uncaught Error: syntax error, unexpected T_CONST, expecting T_VARIABLE in /in/7a1KE:5 Stack trace: #0 {main}
Process exited with code 255.