summaryrefslogtreecommitdiff
path: root/Zend/tests/nullsafe_operator/020.phpt
blob: 4d06ce616cc16e79cdcf807a550dd135ea744cff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
--TEST--
Test nullsafe lhs of assignment to nested property chain
--FILE--
<?php

class Foo {
    public $bar;
}

function bar() {
    var_dump('called');
}

$foo = null;
$foo?->bar->baz = bar();

?>
--EXPECTF--
Fatal error: Can't use nullsafe operator in write context in %s.php on line 12