3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = array(); $a[] = ‘one’; $a[] = ‘44’; $a[‘tree’] = 45; print_r($a);
Output for 7.2.0
Warning: Use of undefined constant ‘one’ - assumed '‘one’' (this will throw an Error in a future version of PHP) in /in/GXVZ4 on line 4 Warning: Use of undefined constant ‘44’ - assumed '‘44’' (this will throw an Error in a future version of PHP) in /in/GXVZ4 on line 5 Warning: Use of undefined constant ‘tree’ - assumed '‘tree’' (this will throw an Error in a future version of PHP) in /in/GXVZ4 on line 6 Array ( [0] => ‘one’ [1] => ‘44’ [‘tree’] => 45 )
Output for 4.3.0 - 7.1.10
Notice: Use of undefined constant ‘one’ - assumed '‘one’' in /in/GXVZ4 on line 4 Notice: Use of undefined constant ‘44’ - assumed '‘44’' in /in/GXVZ4 on line 5 Notice: Use of undefined constant ‘tree’ - assumed '‘tree’' in /in/GXVZ4 on line 6 Array ( [0] => ‘one’ [1] => ‘44’ [‘tree’] => 45 )