3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $x = array(1,2,3); print_r(each($x)); echo "\n"; $y =& $x; print_r(each($y)); echo "\n"; $z =& $y; print_r(each($z)); echo "\n";
Output for 7.2.0
Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /in/5tlaQ on line 4 Array ( [1] => 1 [value] => 1 [0] => 0 [key] => 0 ) Array ( [1] => 2 [value] => 2 [0] => 1 [key] => 1 ) Array ( [1] => 3 [value] => 3 [0] => 2 [key] => 2 )
Output for 4.3.0 - 7.1.10
Array ( [1] => 1 [value] => 1 [0] => 0 [key] => 0 ) Array ( [1] => 2 [value] => 2 [0] => 1 [key] => 1 ) Array ( [1] => 3 [value] => 3 [0] => 2 [key] => 2 )