com php-src: Use ZEND_ACC_REUSE_GET_ITERATOR flag i nstead of run-time class modification: ext/spl/spl _fixedarray.c
| From: | Dmitry Stogov | Date: | Tue, 19 Feb 2019 23:32:29 +0000 |
| Subject: | com php-src: Use ZEND_ACC_REUSE_GET_ITERATOR flag i nstead of run-time class modification: ext/spl/spl _fixedarray.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-104756@lists.php.net to get a copy of this message | ||
Commit: f2e515e9eb78b09ecaed057241e7a43bf2d9f883
Author: Dmitry Stogov <dmitry@zend.com> Wed, 20 Feb 2019 02:32:29 +0300
Parents: 555fb294ec4c1948b357ee43b6ca3c81873ddf26
Branches: PHP-7.4 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f2e515e9eb78b09ecaed057241e7a43bf2d9f883
Log:
Use ZEND_ACC_REUSE_GET_ITERATOR flag instead of run-time class modification
Changed paths:
M ext/spl/spl_fixedarray.c
Diff:
diff --git a/ext/spl/spl_fixedarray.c b/ext/spl/spl_fixedarray.c
index 71548ab..ce93f2a 100644
--- a/ext/spl/spl_fixedarray.c
+++ b/ext/spl/spl_fixedarray.c
@@ -227,7 +227,6 @@ static zend_object *spl_fixedarray_object_new_ex(zend_class_entry *class_type, z
while (parent) {
if (parent == spl_ce_SplFixedArray) {
intern->std.handlers = &spl_handler_SplFixedArray;
- class_type->get_iterator = spl_fixedarray_get_iterator;
break;
}
@@ -1087,6 +1086,7 @@ PHP_MINIT_FUNCTION(spl_fixedarray)
REGISTER_SPL_IMPLEMENTS(SplFixedArray, Countable);
spl_ce_SplFixedArray->get_iterator = spl_fixedarray_get_iterator;
+ spl_ce_SplFixedArray->ce_flags |= ZEND_ACC_REUSE_GET_ITERATOR;
return SUCCESS;
}