Bug #13699 Updated: when using single quotes, print/printf prints literal "\n"

From: Date: Wed, 17 Oct 2001 14:49:17 +0000
Subject: Bug #13699 Updated: when using single quotes, print/printf prints literal "\n"
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-68135@lists.php.net to get a copy of this message
ID: 13699 Updated by: jeroen Reported By: beckman@purplecow.com Status: Bogus Bug Type: Output Control Operating System: FreeBSD 4.1 PHP Version: 4.0.6 New Comment: Look in "Part language" - types - strings - single-quoted Previous Comments: ------------------------------------------------------------------------ [2001-10-16 19:51:31] mfischer@php.net This is the intended behaviour when using single quotes. See the appropriate manual entry (sorry don't know it by heart). - Markus ------------------------------------------------------------------------ [2001-10-16 19:31:59] beckman@purplecow.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 <?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 <?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. ------------------------------------------------------------------------ Edit this bug report at http://bugs.php.net/?id=13699&edit=1

« previous php.dev (#68135) next »