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
 [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

Pull Requests

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: Sun Dec 08 11:01:29 2024 UTC