|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #13699 when using single quotes, print/printf prints literal "\n"
Submitted: 2001-10-16 19:31 UTC Modified: 2001-10-17 10:49 UTC
From: beckman at purplecow dot com Assigned:
Status: Not a bug Package: Output Control
PHP Version: 4.0.6 OS: FreeBSD 4.1
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 !
Your email address:
Solve the problem:
46 + 28 = ?
Subscribe to this entry?

 [2001-10-16 19:31 UTC] beckman at purplecow dot com
This has been confirmed in 4.0.6 on the web and as a standalone for both print and printf.

Output from a test:
(root) hot: 1 : /content/adcritic --> php
printf('<a href="http://">%s</a>\n',"hi");
X-Powered-By: PHP/4.0.6
Content-type: text/html

<a href="http://">hi</a>\n(root) hot: 1 : /content/adcritic --> php
printf("<a href='http://'>%s</a>\n","hi");
X-Powered-By: PHP/4.0.6
Content-type: text/html

<a href='http://'>hi</a>

This works:
printf("<a href='http://'>%s</a>\n","hi");

This does NOT work (prints literal "\n"):
printf('<a href="http://">%s</a>\n',"hi");

Same applies to print.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-10-16 19:51 UTC]
This is the intended behaviour when using single quotes. See the appropriate manual entry (sorry don't know it by heart).

- Markus
 [2001-10-17 10:49 UTC]
Look in "Part language" - types - strings - single-quoted
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Jul 15 00:01:28 2024 UTC