summaryrefslogtreecommitdiff
path: root/Zend/tests/assign_ref_error_var_handling.phpt
blob: 5ecb577ba7ccff3852f01ac4d23c2406b65200bf (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
--TEST--
If the LHS of ref-assign ERRORs, that takes precedence over the "only variables" notice
--FILE--
<?php

function val() {
    return 42;
}

$str = "foo";
$var = 24;
var_dump($str->foo =& $var);
var_dump($str);
var_dump($str->foo =& val());
var_dump($str);

?>
--EXPECTF--
Warning: Attempt to modify property 'foo' of non-object in %s on line %d
NULL
string(3) "foo"

Warning: Attempt to modify property 'foo' of non-object in %s on line %d
NULL
string(3) "foo"