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:2
Avg. Score:3.5 ± 0.5
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
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
 [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-2017 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC