3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $array = array('ça', 'ne', 'marche', 'pas'); foreach($array as &$value) { var_dump($array); unset($array); var_dump($value); var_dump($array); }
Output for 5.0.4 - 7.1.0
array(4) { [0]=> &string(3) "ça" [1]=> string(2) "ne" [2]=> string(6) "marche" [3]=> string(3) "pas" } string(3) "ça" Notice: Undefined variable: array in /in/6Lgpc on line 10 NULL Notice: Undefined variable: array in /in/6Lgpc on line 7 NULL string(2) "ne" Notice: Undefined variable: array in /in/6Lgpc on line 10 NULL Notice: Undefined variable: array in /in/6Lgpc on line 7 NULL string(6) "marche" Notice: Undefined variable: array in /in/6Lgpc on line 10 NULL Notice: Undefined variable: array in /in/6Lgpc on line 7 NULL string(3) "pas" Notice: Undefined variable: array in /in/6Lgpc on line 10 NULL
Output for 5.0.0 - 5.0.3
array(4) { [0]=> &string(3) "ça" [1]=> string(2) "ne" [2]=> string(6) "marche" [3]=> string(3) "pas" } string(3) "ça" Notice: Undefined variable: array in /in/6Lgpc on line 10 NULL Notice: Undefined variable: array in /in/6Lgpc on line 7 NULL string(2) "ne" Notice: Undefined variable: array in /in/6Lgpc on line 10 NULL Notice: Undefined variable: array in /in/6Lgpc on line 7 NULL string(6) "marche" Notice: Undefined variable: array in /in/6Lgpc on line 10 NULL Notice: Undefined variable: array in /in/6Lgpc on line 7 NULL string(3) "pas" Notice: Undefined variable: array in /in/6Lgpc on line 10 NULL
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected '&', expecting T_VARIABLE or '$' in /in/6Lgpc on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected '&', expecting T_VARIABLE or '$' in /in/6Lgpc on line 5
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_VARIABLE' or `'$'' in /in/6Lgpc on line 5
Process exited with code 255.