1
0
mirror of https://github.com/php/php-src.git synced 2026-04-27 10:16:41 +02:00
Files
archived-php-src/Zend/tests/nullsafe_operator/021.phpt
T
Ilija Tovilo 9bf119832d Implement nullsafe ?-> operator
RFC: https://wiki.php.net/rfc/nullsafe_operator

Closes GH-5619.

Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
2020-07-24 10:05:03 +02:00

22 lines
295 B
PHP

--TEST--
Test nullsafe in list assign
--FILE--
<?php
class Foo {
public $bar;
}
class Bar {
public $baz;
}
$foo = new Foo();
$foo->bar = new Bar();
[$foo?->bar->baz] = ['bar'];
var_dump($foo);
--EXPECTF--
Fatal error: Assignments can only happen to writable values in %s on line %d