summaryrefslogtreecommitdiff
path: root/sapi/cli/php_cli.c
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2020-03-04 10:10:36 +0100
committerNikita Popov <nikita.ppv@gmail.com>2020-03-04 10:29:21 +0100
commitc05a9c3dcd587418906d9d25f83872e027f7dd43 (patch)
tree7c4ab9a194c44cf75c504634a8b576875ec3f9ab /sapi/cli/php_cli.c
parenta527c60ede98d51785091ceb380242b0ffeab5ad (diff)
downloadphp-git-c05a9c3dcd587418906d9d25f83872e027f7dd43.tar.gz
Implement interfaces after all methods available
The place where interface implementation handlers is called is currently ill-defined: If the class implements interfaces itself, the handlers for both the parent interfaces and the new interfaces will be called after all methods are registered (post trait use). If the class does not implement interfaces, then the parent interface handlers are called early during inheritance (before methods are inherited). This commit moves the calls to always occur after all methods are available. For userland classes this will be post trait import, at the time where interfaces get implemented (whether the class itself defines additional interfaces or not). For internal classes it will be at the end of inheritance, as internal class declarations do not have proper finalization. This allows us to simplify the logic for implementing the magic Iterator / IteratorAggregate interfaces. In particularly we can now also automatically detect whether an extension of IteratorAggregate can safely reuse a custom get_iterator handler, or whether it needs to switch to the userland mechanism. The Iterator case continues to rely on ZEND_ACC_REUSE_GET_ITERATOR for this purpose, as a wholesale replacement is not possible there.
Diffstat (limited to 'sapi/cli/php_cli.c')
0 files changed, 0 insertions, 0 deletions