3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function do_ref(&$ref) { foreach ($ref as $index => $value) { unset($ref[$index]); } } $array = ['foo' => [1 => 'bar']]; do_ref($array); print_r($array);
based on 53UQJ
Output for 5.4.0 - 7.3.0beta1
Array ( )
Output for 5.3.19 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/OjYHI on line 10
Process exited with code 255.