|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2007-08-24 12:05 UTC] nikhil dot gupta at in dot ibm dot com
Description: ------------ As per the documentation, it should insert a backslash in the return string. But it returns an empty string without any backslash. Reproduce code: --------------- <?php var_dump( NULL); var_dump( addslashes(NULL) ); ?> Expected result: ---------------- NULL string(1) "\" Actual result: -------------- NULL string(0) "" PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 13:00:01 2025 UTC |
Thankyou for correcting me. I tried with NUL character (\0) also. Is following the expected output? var_dump( addslashes("abc\0abc") ); The output I get is: string(8) "abc\0abc" OR should it be: string(8) "abc\abc" (here a backslash is added before NUL) OR should it be: string(8) "abc\\0abc" I think here the output should be: string(8) "abc\\0abc" because here the NUL is preceded with backslash character and also the length of string is 8.