From: Nikita Popov Date: Thu, 22 Sep 2016 10:48:38 +0000 (+0200) Subject: Merge branch 'PHP-5.6' into PHP-7.0 X-Git-Tag: php-7.0.12RC1~29 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c38f88ddb077f815bfdfff5c63ec76c6f6119c18;p=php Merge branch 'PHP-5.6' into PHP-7.0 --- c38f88ddb077f815bfdfff5c63ec76c6f6119c18 diff --cc ext/spl/spl_iterators.c index 0977228faa,878e5a10f0..7b4c73dcec --- a/ext/spl/spl_iterators.c +++ b/ext/spl/spl_iterators.c @@@ -2042,19 -2048,29 +2042,20 @@@ SPL_METHOD(RegexIterator, accept if (zend_parse_parameters_none() == FAILURE) { return; } - + SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis()); - - if (intern->current.data == NULL) { + + if (Z_TYPE(intern->current.data) == IS_UNDEF) { RETURN_FALSE; - } else if (Z_TYPE(intern->current.data) == IS_ARRAY) { - RETURN_FALSE; } if (intern->u.regex.flags & REGIT_USE_KEY) { - subject_ptr = intern->current.key; + subject = zval_get_string(&intern->current.key); } else { - if (Z_TYPE_P(intern->current.data) == IS_ARRAY) { ++ if (Z_TYPE(intern->current.data) == IS_ARRAY) { + RETURN_FALSE; + } - subject_ptr = intern->current.data; - } - - zend_make_printable_zval(subject_ptr, &subject_copy, &use_copy); - if (use_copy) { - subject = Z_STRVAL(subject_copy); - subject_len = Z_STRLEN(subject_copy); - } else { - subject = Z_STRVAL_P(subject_ptr); - subject_len = Z_STRLEN_P(subject_ptr); + subject = zval_get_string(&intern->current.data); } switch (intern->u.regex.mode)