]> granicus.if.org Git - php/commitdiff
Merge branch 'PHP-5.6' into PHP-7.0
authorNikita Popov <nikic@php.net>
Thu, 22 Sep 2016 10:48:38 +0000 (12:48 +0200)
committerNikita Popov <nikic@php.net>
Thu, 22 Sep 2016 10:48:38 +0000 (12:48 +0200)
1  2 
ext/spl/spl_iterators.c

index 0977228faa1b9751d963ec324a5d4253b5fa4260,878e5a10f0138f36a7cd014094ee790d4cd8353e..7b4c73dcecc9773bdf35d28b45adb03eb62df481
@@@ -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)