3v4l.org

run code in 200+ php & hhvm versions
<?php define('FOO', 1); class bar { static $v = [ FOO => 1, FOOX => 1, ]; static $w; } // If following line is commentted out, undefined constant error disappears. var_dump(bar::$w);
based on OMh4B
Output for 7.2.0 - 7.2.6
Warning: Use of undefined constant FOOX - assumed 'FOOX' (this will throw an Error in a future version of PHP) in /in/ULp0K on line 14 NULL
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.1.20
Notice: Use of undefined constant FOOX - assumed 'FOOX' in /in/ULp0K on line 14 NULL
Output for hhvm-3.22.0
Notice: Use of undefined constant FOOX - assumed 'FOOX' in /in/ULp0K on line -1 NULL
Output for hhvm-3.18.5 - 3.21.3
Notice: Use of undefined constant FOOX - assumed 'FOOX' in /in/ULp0K on line 7 NULL