3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $arrayIterator = new ArrayIterator(range(1,10)); foreach($arrayIterator as $key => &$value) { $value *= 10; } var_dump($arrayIterator->getArrayCopy());
Output for 5.2.1 - 7.1.0
array(10) { [0]=> int(10) [1]=> int(20) [2]=> int(30) [3]=> int(40) [4]=> int(50) [5]=> int(60) [6]=> int(70) [7]=> int(80) [8]=> int(90) [9]=> &int(100) }
Output for 5.0.0 - 5.2.0
array(10) { [0]=> &int(10) [1]=> &int(20) [2]=> &int(30) [3]=> &int(40) [4]=> &int(50) [5]=> &int(60) [6]=> &int(70) [7]=> &int(80) [8]=> &int(90) [9]=> &int(100) }
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected '&', expecting T_VARIABLE or '$' in /in/rD08m 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/rD08m 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/rD08m on line 5
Process exited with code 255.