3v4l.org

run code in 300+ PHP versions simultaneously
<?php $list = array("A","B","C","D"); $childList = $list; foreach ( $childList as $key => &$var ) { cleanChild($childList, $list, $var, $key); $childList = $list; } echo "\n"; function cleanChild(&$childList, &$list, $var, $key) { if ($key == 'B') { unset($list[$key]); } } ?>
Output for 5.3.0 - 5.3.27, 5.4.0 - 5.4.19, 7.2.29 - 7.2.33, 7.3.16 - 7.3.33, 7.4.3 - 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

Process exited with code 137.

preferences:
140.59 ms | 403 KiB | 188 Q