3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $list = ['first' => '1', 'second' => '2', 'third' => '3']; foreach ( $list as $i ) { list ( $k, $v ) = each ( $i ); var_dump($k);var_dump($v); }
Output for 7.2.0 - 7.3.0beta1
Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /in/RuPfk on line 6 Warning: Variable passed to each() is not an array or object in /in/RuPfk on line 6 NULL NULL Warning: Variable passed to each() is not an array or object in /in/RuPfk on line 6 NULL NULL Warning: Variable passed to each() is not an array or object in /in/RuPfk on line 6 NULL NULL
Output for 5.6.0 - 5.6.30, 7.1.0 - 7.1.20
Warning: Variable passed to each() is not an array or object in /in/RuPfk on line 6 NULL NULL Warning: Variable passed to each() is not an array or object in /in/RuPfk on line 6 NULL NULL Warning: Variable passed to each() is not an array or object in /in/RuPfk on line 6 NULL NULL
Output for hhvm-3.22.0
Warning: Invalid operand type was used: expecting an array in /in/RuPfk on line -1 NULL NULL Warning: Invalid operand type was used: expecting an array in /in/RuPfk on line -1 NULL NULL Warning: Invalid operand type was used: expecting an array in /in/RuPfk on line -1 NULL NULL
Output for hhvm-3.18.5 - 3.21.3
Warning: Invalid operand type was used: expecting an array in /in/RuPfk on line 6 NULL NULL Warning: Invalid operand type was used: expecting an array in /in/RuPfk on line 6 NULL NULL Warning: Invalid operand type was used: expecting an array in /in/RuPfk on line 6 NULL NULL