php-8.0.30-src/Zend/tests/nullsafe_operator/008.phpt

12 lines
207 B
PHP

--TEST--
Test nullsafe property coalesce assignment
--FILE--
<?php
$foo = null;
var_dump($foo?->bar ??= 'bar');
?>
--EXPECTF--
Fatal error: Can't use nullsafe operator in write context in %s.php on line 4