note 14212 added to language.types.array.php
| From: | auto1028 at hushmail dot com | Date: | Sun, 22 Jul 2001 21:26:55 +0000 |
| Subject: | note 14212 added to language.types.array.php | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-15675@lists.php.net to get a copy of this message | ||
This is what I got when I turned full error reporting (8) on for the FastTemplates class
(http://www.thewebmasters.net/php/FastTemplate.phtml) and is an example of how php 4 has changed its
handling of indices.
Warning: Use of undefined constant start - assumed 'start'
Warning: Use of undefined constant theme - assumed 'theme'
for the code
start => "theme" . $HTTP_COOKIE_VARS[theme] . ".tpl"
PHP 4 will give these warnings since if you don't use quotes around an index, it will assume
the index is a constant, and is complaining that you have not defined it as such.
The fix is to identify the index as a constant or a string and then treat it correctly. In these
cases, both indices were strings and the fix was to add quotes.
"start" => "theme" . $HTTP_COOKIE_VARS["theme"] .
".tpl"
gemini1 at Gemini 1 Consulting LLC
http://www.php.net/manual/en/language.types.array.php