3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = [1]; $a[] = &$a[out(count($a) - 1)]; var_dump($a); function out($what) { var_dump($what); return $what; }
based on ETlif
Output for 5.5.0 - 5.5.38, 5.6.0 - 5.6.28, 7.0.4 - 7.0.20, 7.1.0 - 7.1.25, 7.2.0 - 7.2.33, 7.3.0 - 7.3.26, 7.4.0 - 7.4.14, 8.0.0
int(0) array(2) { [0]=> &int(1) [1]=> &int(1) }
Output for 7.0.0 - 7.0.3
int(1) array(2) { [0]=> int(1) [1]=> NULL }