|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27190 bug in stripslashes function with \0
Submitted: 2004-02-09 04:42 UTC Modified: 2004-02-09 11:38 UTC
From: tohar at sphera dot com Assigned:
Status: Not a bug Package: Strings related
PHP Version: 4.3.4 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: tohar at sphera dot com
New email:
PHP Version: OS:


 [2004-02-09 04:42 UTC] tohar at sphera dot com
When using stripslashes function on a string with \0, the 0 character which should have returned, doesnt returned!!!

Reproduce code:
$x1 = 'a\b\c\22\0||TYPE';

$x2 = 'a\b\c\22\13||TYPE';

echo stripslashes($x1);
echo "<BR>";
echo stripslashes($x2);

Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-02-09 05:28 UTC]
Next time use var_dump() which is better. Looks like \0 is intepreted as NULL byte.
$x1 = 'a\b\c\22\0||TYPE';

$x2 = 'a\b\c\22\13||TYPE';

echo "\n";
echo "\n";
Output :
string(12) "abc22||TYPE"

string(13) "abc2213||TYPE"

 [2004-02-09 05:37 UTC]
And that's what it bug here.

 [2004-02-09 11:38 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at

See also docs foor addslashes and stripslashes.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Apr 21 11:01:27 2024 UTC