|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #61226 mysql_escape_string deprecated notice does not appear with E_ALL
Submitted: 2012-03-01 19:21 UTC Modified: 2017-04-02 14:41 UTC
Avg. Score:4.0 ± 0.8
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:1 (50.0%)
From: dpk at dpk dot net Assigned:
Status: Wont fix Package: mysql (PECL)
PHP Version: 5.3.10 OS: All
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
8 + 47 = ?
Subscribe to this entry?

 [2012-03-01 19:21 UTC] dpk at dpk dot net
mysql_escape_string was deprecated in PHP 5.3, but the deprecation notice is only 
displayed if you have MySQL trace_mode enabled. IMO, E_ALL should be sufficient to 
enable any deprecation notices for code distributed with PHP. Examples of other 
ext/* code that simply shows the error without additional conditions can be found 
in ext/date/php_date.c and ext/standard/string.c.

Test script:

Expected result:
Deprecated: mysql_escape_string(): This function is deprecated; use 
mysql_real_escape_string() instead. in /home/dpk/test.php on line 4

Actual result:
Actual result is blank.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2012-05-02 07:08 UTC]
There's indeed an inconsistency going back to 2008 and a test for a condition that should go away:

   1814  103321       georg 	if (MySG(trace_mode)){
   1815  253598       helly 		php_error_docref("function.mysql-real-escape-string" TSRMLS_CC, E_DEPRECATED, "This function is deprecated; use mysql_real_escape_string() instead.");
   1816  103321       georg 	}

It's fixed in 5.4, however.
 [2017-04-02 14:41 UTC]
-Status: Open +Status: Wont fix
 [2017-04-02 14:41 UTC]
The mysql extension in no longer maintained since the mysqli and PDO extensions are favoured now. This issue will therefore be closed.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sun Jun 04 21:03:39 2023 UTC