summaryrefslogtreecommitdiff
path: root/Zend/tests/bug72038.phpt
blob: 201fbbf40b298a83d1c290d4ff7233d705caa04a (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
25
26
27
28
29
30
--TEST--
Bug #72038 (Function calls with values to a by-ref parameter don't always throw a notice)
--FILE--
<?php

try {
    test($foo = new stdClass);
    var_dump($foo);
} catch (Error $e) {
    echo $e->getMessage() . "\n";
}
try {
    test($bar = 2);
    var_dump($bar);
} catch (Error $e) {
    echo $e->getMessage() . "\n";
}

test($baz = &$bar);
var_dump($baz);

function test(&$param) {
        $param = 1;
}

?>
--EXPECT--
test(): Argument #1 ($param) cannot be passed by reference
test(): Argument #1 ($param) cannot be passed by reference
int(1)