[php-src] PR #22212: Zend: add object_init_instantiable_class() API and use it
| From: | Girgias | Date: | Tue, 02 Jun 2026 18:36:31 +0000 |
| Subject: | [php-src] PR #22212: Zend: add object_init_instantiable_class() API and use it | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-36279@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/22212
Author: Girgias
This is an idea that kinda came up while working on #19797
In most cases when an extension calls
object_init_ex() it's instantiating one of
its own classes, and thus it knows it is instantiable. Therefore, I propose to introduce a new API
which skips the (albeit cheap) check.
The secondary motivation is that I'm not fully certain I agree that it should be the task of
object_init_ex() to check if an object is instantiable. This is especially relevant for
#19797 as I would like to have a single API to that checks that the CE is a concrete class, but also
that the constructor is actually callable (i.e. public or within scope) *prior* to attempting to
create the object.