1--TEST--
2If the LHS of ref-assign ERRORs, that takes precedence over the "only variables" notice
3--FILE--
4<?php
5
6function val() {
7    return 42;
8}
9
10$str = "foo";
11$var = 24;
12var_dump($str->foo =& $var);
13var_dump($str);
14var_dump($str->foo =& val());
15var_dump($str);
16
17?>
18--EXPECTF--
19Warning: Attempt to modify property 'foo' of non-object in %s on line %d
20NULL
21string(3) "foo"
22
23Warning: Attempt to modify property 'foo' of non-object in %s on line %d
24NULL
25string(3) "foo"
26