php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #65666 Please reference alternatives to depricated split function
Submitted: 2013-09-13 15:04 UTC Modified: 2013-10-02 22:40 UTC
From: joe at joeceresini dot com Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: Irrelevant OS: N/A
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: joe at joeceresini dot com
New email:
PHP Version: OS:

 

 [2013-09-13 15:04 UTC] joe at joeceresini dot com
Description:
------------
---
From manual page: http://www.php.net/function.split#refsect1-function.split-description
---

In the notice below, please add alternatives such as explode and preg_split. I noticed a few posts on forums asking what alternatives are available for split from people that saw it was deprecated. Offering the alternatives on that page will provide a better user experience for those reading the documentation.

Notice from the split doc page:
"This function has been DEPRECATED as of PHP 5.3.0. Relying on this feature is highly discouraged."


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-09-13 15:20 UTC] gabri dot ns at gmail dot com
there is already offered alternative on [Ssee Also] section.
http://www.php.net/function.split#refsect1-function.split-seealso
 [2013-09-14 01:46 UTC] joe at joeceresini dot com
I see there is already a "see also" section, but as a developer, I'm not going to read past parameters, return values and examples to find alternatives. I could have sworn I've seen other deprecated functions with alternatives directly in the deprecation warning. If it were my decision, that's where I'd put them.
 [2013-09-16 12:17 UTC] cmbecker69 at gmx dot de
The notes[1] on the manual page are quite explicit about 
alternatives.  IMHO that is sufficient in addition to the 
prominent deprecation warning.

[1] <http://de3.php.net/function.split#refsect1-function.split-notes>
 [2013-10-02 20:07 UTC] krakjoe@php.net
-Status: Open +Status: Not a bug
 [2013-10-02 20:07 UTC] krakjoe@php.net
All we can do is put the documentation out there ... you have to read it.
 [2013-10-02 22:40 UTC] joe at joeceresini dot com
And I can only make suggestions that I think will benefit your community of users. Heres some of the functions that have alternatives in the deprecation warning or just above or below it:

http://www.php.net/manual/en/function.mysql-list-dbs.php
http://www.php.net/manual/en/function.mysql-escape-string.php
http://www.php.net/manual/en/function.mcrypt-ecb.php
http://www.php.net/manual/en/function.mcrypt-cbc.php

So consistency...

Also, if the first thing I read is "don't use this function", I'm not going to read much further.

The deprecation warning is, in my opinion, a great place to suggest alternatives. If you disagree that's fine, but its at least worth thinking about.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Jun 16 04:01:28 2024 UTC