3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php const CONST1 = [1 => 'bla']; $foo = 1; if (isset(CONST1[$foo])) { echo CONST1[$foo]; }
based on mbu4g
Output for hhvm-3.21.3 - 3.22.0, 7.0.30 - 7.3.0beta1
bla
Output for hhvm-3.18.5
Warning: Constants may only evaluate to scalar values in /in/CKJ9E on line 3 Notice: Use of undefined constant CONST1 - assumed 'CONST1' in /in/CKJ9E on line 6 Notice: Use of undefined constant CONST1 - assumed 'CONST1' in /in/CKJ9E on line 7 O
Output for 5.6.30
Fatal error: Cannot use isset() on the result of an expression (you can use "null !== expression" instead) in /in/CKJ9E on line 6
Process exited with code 255.