[php-src] PR #12037: ext/spl: Fix various ArrayObject bugs
| From: | Girgias | Date: | Wed, 23 Aug 2023 14:58:56 +0000 |
| Subject: | [php-src] PR #12037: ext/spl: Fix various ArrayObject bugs | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-23455@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/12037
Author: Girgias
This fixes:
- https://github.com/php/php-src/issues/9432
- https://github.com/php/php-src/issues/9434
- Throwing an error when appending a backing object via `
$ao[] = $v`
- Writing inaccessible private/protected properties
- And other bugs...
ArrayObject is dealing with the property HashTable directly, this is not much of an issue for read,
isset, and empty operations.
However, write operations are very different in that classes can impose restriction on those,
ranging from visibility, types and dynamic properties.
Moreover, for some unknown reason, ArrayObject does not use the backing class overloaded property
access magic methods and tests for this. Meaning, we cannot just use the standard
`write_property handler of the CE, thus we need to reimplement it ourself to
dodge the __set()` call.
Commit 1 is just code rearranging so that I could navigate this file more easily...