Re: Bug #3003: split() limit not working correctly
| From: | Stanislav Malyshev | Date: | Sun, 19 Dec 1999 12:51:49 +0000 |
| Subject: | Re: Bug #3003: split() limit not working correctly | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-13835@lists.php.net to get a copy of this message | ||
>> Operating system: BSD/OS 3.1 i386
>> PHP version: 3.0.12
>> PHP Bug Type: Misbehaving function
>> Bug description: split() limit not working correctly
>>
>> split() seems to be truncating data when using a limit
>> argument, eg.
>>
>> <?php
>> $x = split("-", "a-b-c-d", 2);
>> print $x[1];
>> ?>
>>
>> this should produce "b", but it produces "b-c-d" instead.
Same happens on the last CVS of PHP 4.
From the source I infer that the meaning of "limit" is "do this much of
matches and splits" not "do all possible matches and then return this much
of values". At least it works this way now.
--
Stanislav Malyshev stas@zend.com
+972-50-624945