[php-src] PR #14996: Use zend_std_build_properties() to access zend_object.properties
| From: | arnaud-lb | Date: | Wed, 17 Jul 2024 19:01:54 +0000 |
| Subject: | [php-src] PR #14996: Use zend_std_build_properties() to access zend_object.properties | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-27319@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/14996
Author: arnaud-lb
The
zend_object.properties HashTable needs to be built just in time by calling
rebuild_object_properties() on the object before accessing it. Normally this is done
automatically in zend_std_get_properties(), but we do it manually in a few places, like
this: https://github.com/php/php-src/blob/7d99a9cea11b43f05fda267b5c1ec892ccb8cf95/Zend/zend_API.c#L1782-L1785
In this PR I refactor these places to use zend_std_get_properties() instead. I also
make rebuild_object_properties() static to enforce usage of
zend_std_get_properties().
This refactoring will be useful in the context of the lazy objects RFC, as the
zend_std_get_properties() function becomes a single entry point for
zend_object.properties where we can initialize a lazy object.