php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #9 error using split function
Submitted: 1998-01-26 18:29 UTC Modified: 2011-08-29 13:53 UTC
Votes:16
Avg. Score:3.4 ± 1.4
Reproduced:9 of 12 (75.0%)
Same Version:12 (133.3%)
Same OS:10 (111.1%)
From: gareth at omnipotent dot net Assigned:
Status: Closed Package: *General Issues
PHP Version: 3.0 Latest CVS OS: Linux 2.0.33 / Intel P2/233
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
49 + 3 = ?
Subscribe to this entry?

 
 [1998-01-26 18:29 UTC] gareth at omnipotent dot net
The following scriptet:

<?
  $myarr=split(",",",something,that,starts,with,the,deliminator");
?>
 
returns:
Warning: bad regular expression for split() in /www/splittest.php on line 2

and naturally doesn't assign anything to the $myarr array.

I suppose really you'd expect either to assign an empty value
to the first item in the array, or else to skip the leading
deliminator altogether...

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1998-01-28 01:11 UTC] rasmus
Small side-note: For a simple split like this, using
explode() ( http://www.php.net/manual/function.explode.php3 ) is faster.

The bug in split() has been fixed now.  Patch is available at:

    http://www.php.net/cvsweb.cgi/functions/reg.c?r1=1.68&r2=1.69

Or wait for the the b4 release.
 [2011-08-29 13:53 UTC] bjori@php.net
-Package: Other +Package: *General Issues -Assigned To: +Assigned To: bjori
 [2013-07-18 07:55 UTC] adasdfdsd at ahoo dot com
das
 [2013-12-31 18:53 UTC] bukka@php.net
Automatic comment on behalf of bukka
Revision: http://git.php.net/?p=pecl/tools/fann.git;a=commit;h=6272501586d5f3d89108f8c113f609312343d354
Log: Fix #9: fann_train not working
 [2016-02-26 16:57 UTC] willfitch@php.net
Automatic comment on behalf of wfitch@meetme.com
Revision: http://git.php.net/?p=pecl/numbers/bitset.git;a=commit;h=b795141ff56accf3c373c14ea2206c189f492fc8
Log: Fix #9 clear first bit only
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 01:01:28 2024 UTC