|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits              [2004-06-12 16:14 UTC] derick@php.net
 | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 03:00:01 2025 UTC | 
Description: ------------ If I call preg_split with a string such as ",,foo,,bar,," I expect to get five empty strings back in the returned array, but I only get back two - the first and the last. Reproduce code: --------------- $tokens = preg_split("/[,]+/", ",,foo,,bar,,"); Expected result: ---------------- I expect $tokens to contain the following array: array(12) { [0]=> string(0) "" [1]=> string(0) "" [2]=> string(3) "foo" [3]=> string(0) "" [4]=> string(3) "bar" [5]=> string(0) "" [6]=> string(0) "" } Actual result: -------------- array(12) { [0]=> string(0) "" [1]=> string(3) "foo" [2]=> string(3) "bar" [3]=> string(0) "" }