xref: /PHP-8.1/Zend/tests/bug71529.phpt (revision 9f82f21d)
1--TEST--
2Bug #71529: Variable references on array elements don't work when using count
3--FILE--
4<?php
5
6$a = [1];
7$a[] = &$a[out(count($a) - 1)];
8var_dump($a);
9
10function out($what) {
11    var_dump($what);
12    return $what;
13}
14
15?>
16--EXPECT--
17int(0)
18array(2) {
19  [0]=>
20  &int(1)
21  [1]=>
22  &int(1)
23}
24