|  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
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.
Block user comment
Status: Assign to:
Bug Type:
From: dpk at dpk dot net
New email:
PHP Version: OS:


 [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-2024 The PHP Group
All rights reserved.
Last updated: Sun Jul 21 19:01:34 2024 UTC