summaryrefslogtreecommitdiff
path: root/Zend/tests/nullsafe_operator/024.phpt
blob: 220e9ea5062b9a478aec93a58253a6fa7d3920fe (plain)
1
2
3
4
5
6
7
8
9
10
11
--TEST--
Test nullsafe as foreach target
--FILE--
<?php

$foo = null;
foreach ([1, 2, 3] as $foo?->bar) {}

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