note 53914 added to language.variables.scope
| From: | jameslee at cs dot nmt dot edu | Date: | Thu, 16 Jun 2005 21:26:59 +0000 |
| Subject: | note 53914 added to language.variables.scope | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-90555@lists.php.net to get a copy of this message | ||
In response to Andy Morris and dpk at dpk dot net:
The reason it prints the single "f" is because strings can be treated like arrays just
like in C/C++. The string 'bar' evaluates to integer 0 when being used as an index to the
string "frank", so you get the 0th character of the array.
----
Manual Page -- http://www.php.net/manual/en/language.variables.scope.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+53914
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+53914&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+53914&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+53914&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+53914&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+53914&report=yes&reason=non-english
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+53914&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+53914&report=yes
Search -- http://master.php.net/manage/user-notes.php