xref: /PHP-8.2/ext/standard/tests/array/bug43505.phpt (revision 75a678a7)
1--TEST--
2Bug #43505 (Assign by reference bug)
3--INI--
4error_reporting=0
5--FILE--
6<?php
7class Test implements Countable {
8    #[ReturnTypeWillChange]
9    public function count() {
10        return $some;
11    }
12}
13
14$obj = new Test();
15
16$a = array();
17$b =& $a['test'];
18var_dump($a);
19
20$t = count($obj);
21
22$a = array();
23$b =& $a['test'];
24var_dump($a);
25?>
26--EXPECT--
27array(1) {
28  ["test"]=>
29  &NULL
30}
31array(1) {
32  ["test"]=>
33  &NULL
34}
35