ID: 42945
Updated by: [EMAIL PROTECTED]
Reported By: Arne dot Heizmann at csr dot com
-Status: Open
+Status: Verified
Bug Type: PCRE related
-Operating System: Windows 2000
+Operating System: *
-PHP Version: 5.2.4
+PHP Version: 5CVS-2007-10-22
New Comment:
Verified using latest CVS snapshot.
Previous Comments:
------------------------------------------------------------------------
[2007-10-12 12:04:43] Arne dot Heizmann at csr dot com
Description:
------------
The following example code shows how preg_split() - when used with
PREG_SPLIT_NO_EMPTY - omits pieces which aren't empty. The returned
array SHOULD contain ALL of the characters from the original string
minus the characters that match the separator. In my example, the
separator is a zero-width match.
I notice that this problem was reported as Bug #15413 before and marked
"Bogus". My example shows that the bug is real.
Reproduce code:
---------------
<?
header ('Content-type: text/plain');
var_export (preg_split ('/\b/', 'a\'', -1, PREG_SPLIT_NO_EMPTY));
?>
Expected result:
----------------
array (
0 => 'a',
1 => '\'',
)
Actual result:
--------------
array (
0 => 'a',
)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=42945&edit=1