php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login go to bug id or search bugs for
Bug #185 Submitted: fputs puts wrong count when Backslash in string 1998-03-18 00:55 UTC 1998-03-28 14:32 UTC philip at qs dot co dot nz Closed Other 3.0b6 Linx-ELF i586 No None
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 !

[1998-03-18 00:55 UTC] philip at qs dot co dot nz
If a backslash is in a string to fputs, then fputs adds an extra character
to the output stream for every backslash

for example:
$ip="abc\def"; fclose($fp);
$fp = fopen("out","w+");$x=fputs($fp,"$ip");
fclose(\$fp);

File out contains:

61 62 63 5c 64 65 66 00
a   b  c  \  d  e  f nul

The same result will be given for the string "abc\\def".



## Pull Requests

This is the correct behavior. As noted in the ChangeLog for 3.0b4, "\Z" (where Z