[php-src] Issue #7942: Readonly properties mutable when assigning reference to them

From: Date: Sun, 16 Jan 2022 09:14:41 +0000
Subject: [php-src] Issue #7942: Readonly properties mutable when assigning reference to them
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-239037@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/7942 Comment Author: nikic Always falling back to read_property for readonly props means that $obj->prop[] = 1 no longer works as an initializing assignment (it will generate a "must not be accessed before initialization" error). That's probably not a big loss, as the sane way to write that would be $obj->prop = [1] (you can only do the append once). The error message for the $obj->prop =& $ref case is also not great (same "accessed before initialization" error).

« previous php.bugs (#239037) next »