xref: /PHP-8.0/Zend/tests/bug22836.phpt (revision f8d79582)
1--TEST--
2Bug #22836 (returning references to NULL)
3--FILE--
4<?php
5function &f()
6{
7    $x = "foo";
8    var_dump($x);
9    print "'$x'\n";
10    return ($a);
11}
12for ($i = 0; $i < 8; $i++) {
13    $h =& f();
14}
15?>
16--EXPECT--
17string(3) "foo"
18'foo'
19string(3) "foo"
20'foo'
21string(3) "foo"
22'foo'
23string(3) "foo"
24'foo'
25string(3) "foo"
26'foo'
27string(3) "foo"
28'foo'
29string(3) "foo"
30'foo'
31string(3) "foo"
32'foo'
33