php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #51418 Deprecated functions should recommend replacements
Submitted: 2010-03-28 14:19 UTC Modified: 2010-03-28 15:09 UTC
From: lion at netngine dot hu Assigned:
Status: Not a bug Package: Website problem
PHP Version: Irrelevant OS: all
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: lion at netngine dot hu
New email:
PHP Version: OS:

 

 [2010-03-28 14:19 UTC] lion at netngine dot hu
Description:
------------
Deprecated functions are marked with a big red warning on the website, like for example this one:

http://hu.php.net/manual/en/function.eregi.php

The warning text is:

"This function has been DEPRECATED as of PHP 5.3.0. Relying on this feature is highly discouraged."

But there is absolutely no idea given of what kind of other functions could be used to replace the deprecated function. Especially bad when trying to fix an older script to work on an updated server, with no serious knowledge of every old function used in an old script. 

One needs to clearly read the function, understand old behavior, then start from the Table Of Contents of PHP documentation, try to find a new function, and then convert the call.

Instead, these warnings should

1. link to recommended replacements
2. note most important changes between the old and new function

Note that I also checked "See also" links on many deprecated functions when I ran into this problem, and in most cases all see-also are also deprecated, so no there is no help.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-03-28 15:09 UTC] degeberg@php.net
-Status: Open +Status: Bogus
 [2010-03-28 15:09 UTC] degeberg@php.net
The eregi() function has a note that says:

"Note: As of PHP 5.3.0, the regex extension is deprecated in favor of the PCRE extension. Calling this function will issue an E_DEPRECATED notice."

We also have a list of deprecated features along with suitable replacements:
http://php.net/manual/en/migration53.deprecated.php

Generally, the migration guides will help you when upgrading PHP.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 21 04:01:35 2024 UTC