3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $params = [1,2,3]; function transform(array $params) { $references = []; foreach ($params as $key => $value) { $references[$key] = &$params[$key]; } unset($value); $value = "foo"; return $references; return $references; } var_dump($params); $params = transform($params); var_dump($params); $hovno = 'prdel'; $prdel = &$hovno; var_dum($hovno); var_dump($prdel);
based on 7iLBF
Output for 7.0.0 - 7.2.0
array(3) { [0]=> int(1) [1]=> int(2) [2]=> int(3) } array(3) { [0]=> int(1) [1]=> int(2) [2]=> int(3) } Fatal error: Uncaught Error: Call to undefined function var_dum() in /in/Lr9fS:25 Stack trace: #0 {main} thrown in /in/Lr9fS on line 25
Process exited with code 255.
Output for 5.4.9 - 5.6.28
array(3) { [0]=> int(1) [1]=> int(2) [2]=> int(3) } array(3) { [0]=> int(1) [1]=> int(2) [2]=> int(3) } Fatal error: Call to undefined function var_dum() in /in/Lr9fS on line 25
Process exited with code 255.
Output for 5.3.19 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/Lr9fS on line 3
Process exited with code 255.