mirror of
https://github.com/php/php-src.git
synced 2024-09-21 18:07:23 +00:00
9bf119832d
RFC: https://wiki.php.net/rfc/nullsafe_operator Closes GH-5619. Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
11 lines
198 B
PHP
11 lines
198 B
PHP
--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
|