From: mikael at SPAMMENOTchl dot chalmers dot se
Operating system: Linux
PHP version: 4.3.8
PHP Bug Type: *Regular Expressions
Bug description: PREG_SPLIT_NO_EMPTY strips non-empty pieces in some cases
Description:
------------
In some cases the preg_split strips non-empty pieces when the
PREG_SPLIT_NO_EMPTY flag i set. Specifically when using assertions only to
split on, eg. the string to split on itself is actually empty (but not the
pieces)
Reproduce code:
---------------
$terms = preg_split('/(?<=\d)(?=[a-z���])/', 'ser1ia456l', 0,
PREG_SPLIT_NO_EMPTY);
print_r($terms);
Expected result:
----------------
Array
(
[0] => ser1
[1] => ia456
[2] => l
)
Actual result:
--------------
Array
(
[0] => ser1
[1] => ia456
)
--
Edit bug report at http://bugs.php.net/?id=31965&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=31965&r=trysnapshot4
Try a CVS snapshot (php5.0):
http://bugs.php.net/fix.php?id=31965&r=trysnapshot50
Try a CVS snapshot (php5.1):
http://bugs.php.net/fix.php?id=31965&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=31965&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=31965&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=31965&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=31965&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=31965&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=31965&r=support
Expected behavior: http://bugs.php.net/fix.php?id=31965&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=31965&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=31965&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=31965&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=31965&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=31965&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=31965&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=31965&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=31965&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=31965&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=31965&r=mysqlcfg