3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = [1,2,3,4]; $b = &$a; (unset) $b[2]; var_dump($a, $b);
based on YnOgT
Output for 7.2.0
Deprecated: The (unset) cast is deprecated in /in/RemJE on line 6 array(4) { [0]=> int(1) [1]=> int(2) [2]=> int(3) [3]=> int(4) } array(4) { [0]=> int(1) [1]=> int(2) [2]=> int(3) [3]=> int(4) }
Output for 5.4.1 - 7.1.10
array(4) { [0]=> int(1) [1]=> int(2) [2]=> int(3) [3]=> int(4) } array(4) { [0]=> int(1) [1]=> int(2) [2]=> int(3) [3]=> int(4) }
Output for 5.3.18 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/RemJE on line 3
Process exited with code 255.