3v4l.org

run code in 300+ PHP versions simultaneously
<?php $b = [1, 2, 3]; foreach($b ?: [] as &$v){ $v = $v*2; unset($v); } var_dump($b);

preferences:
27.32 ms | 404 KiB | 5 Q