3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $arr = array( 'string' => 'my string', 'empty string' => '', 'number' => 5, 'zero' => 0, 'null' => null, 'array' => array(1, 2, 3), 'empty_array' => array(), ); foreach ($arr as $key => $value) { echo $key, ' is ', (isset($arr[$key]) ? 'set' : 'not set'), PHP_EOL; }
Output for 4.3.10 - 4.4.9, 5.0.2 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
string is set empty string is set number is set zero is set null is not set array is set empty_array is set
Output for 4.3.0 - 4.3.9, 5.0.0 - 5.0.1
string is set Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/KiB4h on line 14 PHP_EOLempty string is set Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/KiB4h on line 14 PHP_EOLnumber is set Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/KiB4h on line 14 PHP_EOLzero is set Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/KiB4h on line 14 PHP_EOLnull is not set Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/KiB4h on line 14 PHP_EOLarray is set Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/KiB4h on line 14 PHP_EOLempty_array is set Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/KiB4h on line 14 PHP_EOL