ID:               47546
 Updated by:       matt...@php.net
 Reported By:      jordi dot salvat at localbilinglimited dot com
-Status:           Closed
+Status:           Bogus
 Bug Type:         Strings related
 Operating System: Irrelevant
 PHP Version:      5.2.9
 Assigned To:      kalle
 New Comment:

Change reverted, as the behavior was correct. It's the documentation
that's wrong. See Bug #47560 and Bug #47727.

The default value for limit (3rd parameter) is just "unlimited," or the
length of the input string, or PHP_INT_MAX, etc.


Previous Comments:
------------------------------------------------------------------------

[2009-03-03 11:51:05] ka...@php.net

This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation
better.

This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation
better.

Fixed in PHP 5.2.10

------------------------------------------------------------------------

[2009-03-02 17:25:26] jordi dot salvat at localbilinglimited dot com

Description:
------------
http://es.php.net/explode declares that the default value for the 3rd
parameter of the explode function is -1.

The function, however, behaves differently when -1 is passed
explicitly.


Reproduce code:
---------------
php <<'__END__'
<?php
$str = 'one|two|three|four';

print_r(explode('|', $str));
print_r(explode('|', $str, -1));
?>
__END__


Expected result:
----------------
>From the documentation, I would expect to see the same result twice.

Actual result:
--------------
Array
(
    [0] => one
    [1] => two
    [2] => three
    [3] => four
)
Array
(
    [0] => one
    [1] => two
    [2] => three
)



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=47546&edit=1

Reply via email to