note 52047 added to function.print
| From: | justhal at gmail dot com | Date: | Tue, 19 Apr 2005 23:48:22 +0000 |
| Subject: | note 52047 added to function.print | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-88232@lists.php.net to get a copy of this message | ||
I was suprised to note that the variable interpolation of arrays is whitespace-intolerant with
print. Case in point:
print( "Value is { $_GET[ 'value' ] }." ); // Parse error
print( "Value is {$_GET['value']}." ); // Works
I expected that since I could use either syntax outside of a print statement or string, that either
would work just as well inside one. I was mistaken, apparently. It was a bit confusing to me. I
like using the spacing; I think it makes the code look cleaner.
PHP 4.3.2
Red Hat Linux 2.4.21
Apache 2.0.46
----
Manual Page -- http://www.php.net/manual/en/function.print.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+52047
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+52047&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+52047&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+52047&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+52047&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+52047&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+52047&report=yes
Search -- http://master.php.net/manage/user-notes.php