3v4l.org

run code in 300+ PHP versions simultaneously
<?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);
Output for 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
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.5.0 - 5.5.38, 5.6.0 - 5.6.40
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.

preferences:
226.17 ms | 402 KiB | 330 Q