3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $foo[]= array('color' => 'red' , 'size' => 'small'); $foo[]= array('color' => 'blue', 'size' => 'large'); $foo[]= array('size' => 'medium'); reset($foo); while (list($key, $val) = each($foo)) { echo "$key => $val\n"; }
Output for 7.2.0 - 7.2.6
Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /in/VA9EG on line 7 Notice: Array to string conversion in /in/VA9EG on line 8 0 => Array Notice: Array to string conversion in /in/VA9EG on line 8 1 => Array Notice: Array to string conversion in /in/VA9EG on line 8 2 => Array
Output for 5.4.0 - 7.1.20
Notice: Array to string conversion in /in/VA9EG on line 8 0 => Array Notice: Array to string conversion in /in/VA9EG on line 8 1 => Array Notice: Array to string conversion in /in/VA9EG on line 8 2 => Array
Output for 4.3.0 - 5.3.29
0 => Array 1 => Array 2 => Array