summaryrefslogtreecommitdiff
path: root/Zend/tests/bug22836.phpt
blob: 14c9e9f3eda73f009c8c989a55c10bb2890502eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
--TEST--
Bug #22836 (returning references to NULL)
--SKIPIF--
<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 is needed'); ?>
--FILE--
<?php
function &f()
{
	$x = "foo";
        var_dump($x);
        print "'$x'\n";
        return ($a);
}
for ($i = 0; $i < 8; $i++) {
	$h =& f();
}
?>
--EXPECTF--
string(3) "foo"
'foo'

Notice: Undefined variable:  a in %s on line %d

Fatal error: Only variables or references can be returned by reference in %s on line %d