[PHP-BUG] Bug #71199 [NEW]: PREG_SPLIT_NO_EMPTY gives wrong result

[email protected] ("g dot statkute at gmail dot com")
Newsgroups php.bugs
Message-ID <[email protected]>
From:             g dot statkute at gmail dot com
Operating system: Windows 7
PHP version:      5.5.30
Package:          PCRE related
Bug Type:         Bug
Bug description:PREG_SPLIT_NO_EMPTY  gives wrong result

Description:
------------
---
From manual page: http://www.php.net/function.preg-split
---


Test script:
---------------
   $keyw=" some, string,,, separaed by many ... different ; ;
;separators";
        $searchArr = preg_split( "/[;,\.]+/", $keyw ,PREG_SPLIT_NO_EMPTY
 ); 
        print_r($searchArr);

gives: Array ( [0] => some, string,,, separated by many ... different ;
; ;separators ) 



Expected result:
----------------
Array ( [0] => some [1] => string [2] => separated by many [3] =>
different [4] =>  separators ) 

Actual result:
--------------
Array ( [0] => some, string,,, separated by many ... different ; ;
;separators )

-- 
Edit bug report at https://bugs.php.net/bug.php?id=71199&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=71199&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=71199&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=71199&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=71199&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=71199&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=71199&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=71199&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=71199&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=71199&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=71199&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=71199&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=71199&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=71199&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=71199&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=71199&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=71199&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=71199&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=71199&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=71199&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=71199&r=mysqlcfg
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.