php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #52007 Split function
Submitted: 2010-06-06 15:55 UTC Modified: 2010-06-06 18:21 UTC
From: kannthenpalam at gmail dot com Assigned:
Status: Not a bug Package: *General Issues
PHP Version: Irrelevant OS: windows
Private report: No CVE-ID: None
 [2010-06-06 15:55 UTC] kannthenpalam at gmail dot com
Description:
------------
Now i am using 5.3.0 version of php.When i am using the split function it will show the error as follows
Deprecated: Function split() is deprecated 

the code like this

$custdate = '06-06-2010';
split("-",$custdate,3);

Test script:
---------------
$custdate = '06-06-2010';
split("-",$custdate,3);

Expected result:
----------------
i just want to know why this error is occor.


Patches

split (last revision 2010-06-06 13:58 UTC by kannthenpalam at gmail dot com)

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-06-06 16:30 UTC] degeberg@php.net
-Status: Open +Status: Bogus
 [2010-06-06 16:30 UTC] degeberg@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.


 [2010-06-06 18:21 UTC] rasmus@php.net
split() is deprecated because it relies on an old, slow, unmaintained regex 
library.  You should be using peg_split() if you actually need to split on a 
regular expression.  In your case, you are splitting on a single character 
which means you should be using explode().  Using a regex to find a single 
character makes little sense.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri Jun 20 04:01:31 2025 UTC