#34876 [NEW]: preg_split should return empty array when splitting ""
| From: | embeddedlinuxguy at gmail dot com | Date: | Fri, 14 Oct 2005 20:12:17 +0000 |
| Subject: | #34876 [NEW]: preg_split should return empty array when splitting "" | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-86608@lists.php.net to get a copy of this message | ||
From: embeddedlinuxguy at gmail dot com
Operating system: Linux
PHP version: 5.0.5
PHP Bug Type: Feature/Change Request
Bug description: preg_split should return empty array when splitting ""
Description:
------------
$b = preg_split("/q/", "", PREG_SPLIT_NO_EMPTY);
should return an empty array (0 elements). Instead it returns an array
with one element which is an empty string, i.e. (""). This is the same
with or without PREG_SPLIT_NO_EMPTY.
Compare to Perl
my @a = split(/q/, "");
Here @a == () not ("")
--
Edit bug report at http://bugs.php.net/?id=34876&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=34876&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=34876&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=34876&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=34876&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=34876&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=34876&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=34876&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=34876&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=34876&r=support
Expected behavior: http://bugs.php.net/fix.php?id=34876&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=34876&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=34876&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=34876&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=34876&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=34876&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=34876&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=34876&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=34876&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=34876&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=34876&r=mysqlcfg