]> granicus.if.org Git - php/commitdiff
MFH: Fixed bug #47560 (explode()'s limit parameter odd behaviour) by reverting change...
authorMatt Wilmas <mattwil@php.net>
Wed, 1 Apr 2009 17:07:46 +0000 (17:07 +0000)
committerMatt Wilmas <mattwil@php.net>
Wed, 1 Apr 2009 17:07:46 +0000 (17:07 +0000)
NEWS
ext/standard/string.c
ext/standard/tests/strings/bug47546.phpt [deleted file]

diff --git a/NEWS b/NEWS
index 6d9c631deb97c7f5812b3f951176182f231c9280..1dc3fe339bde1801212a4f4c65dc76a6ea3d16fa 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -25,8 +25,6 @@ PHP                                                                        NEWS
   literal). (Ilia)
 - Fixed bug #47616 (curl keeps crashing). (Felipe)
 - Fixed bug #47598 (FILTER_VALIDATE_EMAIL is locale aware). (Ilia)
-- Fixed bug #47546 (Default value for limit parameter in explode is 0, not -1).
-  (Kalle)
 - Fixed bug #47487 (performance degraded when reading large chunks after fix of
   bug #44607). (Arnaud)
 - Fixed bug #47435 (FILTER_FLAG_NO_PRIV_RANGE does not work with ipv6
index 9925b89add37ede89f071f00992db585f9fc467e..0311caa2d59a940767cfce93de6ae615d827c11b 100644 (file)
@@ -1042,7 +1042,7 @@ PHP_FUNCTION(explode)
 
        if (limit == 0 || limit == 1) {
                add_index_stringl(return_value, 0, Z_STRVAL_PP(str), Z_STRLEN_PP(str), 1);
-       } else if (limit < -1 && argc == 3) {
+       } else if (limit < 0 && argc == 3) {
                php_explode_negative_limit(*delim, *str, return_value, limit);
        } else {
                php_explode(*delim, *str, return_value, limit);
diff --git a/ext/standard/tests/strings/bug47546.phpt b/ext/standard/tests/strings/bug47546.phpt
deleted file mode 100644 (file)
index f04f9be..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
---TEST--
-Bug #47546 (Default value for limit parameter in explode is 0, not -1)
---FILE--
-<?php
-$str = 'one|two|three|four';
-
-print_r(explode('|', $str));
-print_r(explode('|', $str, -1));
-?>
---EXPECT--
-Array
-(
-    [0] => one
-    [1] => two
-    [2] => three
-    [3] => four
-)
-Array
-(
-    [0] => one
-    [1] => two
-    [2] => three
-    [3] => four
-)