3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php define('FOOBAR', [1, 2, 3, ['foo' => 'bar']]); var_dump(FOOBAR);
Output for 7.0.0 - 7.3.0
array(4) { [0]=> int(1) [1]=> int(2) [2]=> int(3) [3]=> array(1) { ["foo"]=> string(3) "bar" } }
Output for 5.4.10 - 5.6.38
Warning: Constants may only evaluate to scalar values in /in/5asZE on line 3 Notice: Use of undefined constant FOOBAR - assumed 'FOOBAR' in /in/5asZE on line 5 string(6) "FOOBAR"
Output for 5.3.20 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/5asZE on line 3
Process exited with code 255.