]> granicus.if.org Git - php/commitdiff
Syncronize with 5.6 - __toString should return ""
authorStanislav Malyshev <stas@php.net>
Thu, 13 Oct 2016 06:08:30 +0000 (23:08 -0700)
committerAnatol Belski <ab@php.net>
Thu, 13 Oct 2016 23:58:08 +0000 (01:58 +0200)
(cherry picked from commit 2301608736c82183f8210053a45f78eeef5b0c74)

ext/spl/spl_iterators.c
ext/spl/tests/spl_cachingiterator___toString_basic.phpt

index 6af40af39bbb3d5b67c1d173fc4f891eef343820..af458dae4a7cd3a8b855fb378394c6d2acc607ab 100644 (file)
@@ -2801,7 +2801,7 @@ SPL_METHOD(CachingIterator, __toString)
        if (Z_TYPE(intern->u.caching.zstr) == IS_STRING) {
                RETURN_STR_COPY(Z_STR_P(&intern->u.caching.zstr));
        } else {
-               RETURN_NULL();
+               RETURN_EMPTY_STRING();
        }
 } /* }}} */
 
index 0395b3794d854d5845f6eed4e788c99ae91523ae..57ca5152ed74e996c80b939582de43d52a23ecc8 100644 (file)
@@ -13,4 +13,4 @@ $ci->__toString() // if conversion to string is done by echo, for example, an ex
 );
 ?>
 --EXPECTF--
-NULL
+string(0) ""