#44948 [NEW]: heredoc and nowdoc examples are incorrect

From: Date: Thu, 08 May 2008 17:57:56 +0000
Subject: #44948 [NEW]: heredoc and nowdoc examples are incorrect
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-802@lists.php.net to get a copy of this message
From: stepheneliotdewey at gmail dot com Operating system: N/A PHP version: Irrelevant PHP Bug Type: Documentation problem Bug description: heredoc and nowdoc examples are incorrect Description: ------------ The examples given in the manual for heredoc and nowdoc are incorrect. On this page: http://www.php.net/manual/en/language.types.string.php Example 2 says that it will print: My name is "MyName". I am printing some foo. Now I am printing some Bar2. This should print a capital 'A': \x41 When actually it prints: My name is "MyName". I am printing some Foo. Now, I am printing some Bar2. This should print a capital 'A': A (There are 2 differences here: Foo should be capitalized, and \x41 should be printed as A instead.) Example 3 says that it will print: My name is "$name". I am printing some $foo->foo. Now, I am printing some {$foo->bar[1]}. This should not print a capital 'A': \x41 When actually I'm pretty sure that it should print: My name is "$name". I am printing some $foo->foo. Now, I am printing some {$foo->bar[1]}. This should not print a capital 'A': x41 (I have not tested the problem with Example 3 because I only have PHP 5.1. The only error in Example 3 is that there should not be a slash before the x, because there is not one in the example. Alternatively, you could add a slash in the example). Also, in both cases, you are preserving the line breaks, but you should clarify that the line breaks would not be displayed in an HTML context. Reproduce code: --------------- n/a see above Expected result: ---------------- n/a see above Actual result: -------------- n/a see above -- Edit bug report at http://bugs.php.net/?id=44948&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=44948&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=44948&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=44948&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=44948&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=44948&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=44948&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=44948&r=needscript Try newer version: http://bugs.php.net/fix.php?id=44948&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=44948&r=support Expected behavior: http://bugs.php.net/fix.php?id=44948&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=44948&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=44948&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=44948&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=44948&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=44948&r=dst IIS Stability: http://bugs.php.net/fix.php?id=44948&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=44948&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=44948&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=44948&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=44948&r=mysqlcfg

« previous php.doc.bugs (#802) next »