|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-06-27 01:22 UTC] tony2001@php.net
[2005-07-05 01:00 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Nov 18 08:00:01 2025 UTC |
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 )