3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $array = array('foo' => 'bar'); echo $array[foo], "\n"; echo $array[bar], "\n";
Output for 5.3.0 - 5.6.28, hhvm-3.12.0, 7.0.0 - 7.1.0
Notice: Use of undefined constant foo - assumed 'foo' in /in/cNNtg on line 4 bar Notice: Use of undefined constant bar - assumed 'bar' in /in/cNNtg on line 5 Notice: Undefined index: bar in /in/cNNtg on line 5
Output for hhvm-3.10.0
Notice: Use of undefined constant foo - assumed 'foo' in /in/cNNtg on line 6 bar Notice: Use of undefined constant bar - assumed 'bar' in /in/cNNtg on line 8 Notice: Undefined index: bar in /in/cNNtg on line -1
Output for 4.3.0 - 5.2.17
Notice: Use of undefined constant foo - assumed 'foo' in /in/cNNtg on line 4 bar Notice: Use of undefined constant bar - assumed 'bar' in /in/cNNtg on line 5 Notice: Undefined index: bar in /in/cNNtg on line 5