[php-src] PR #12244: Fetch for read in nested property assignments
| From: | iluuu1994 | Date: | Tue, 19 Sep 2023 13:35:27 +0000 |
| Subject: | [php-src] PR #12244: Fetch for read in nested property assignments | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-23636@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/12244
Author: iluuu1994
$a->b->c = 'd';
is now compiled the same way as
$b = $a->b;
$b->c = 'd';
That is, we perform a read fetch on $a->b, rather than a write fetch.
This is possible, because PHP 8 removed auto-vivification support for objects, so $a->b->c =
'd' may no longer modify $a->b proper (i.e. not counting interior mutability of the
object).