php-developer-list | 2000111
Date: 11/09/00
- Next message: Andi Gutmans: "Re: [PHP-DEV] Re: [PHP-QA] RFC:PHP Release Cycle"
- Previous message: hardy.muxel <email protected>: "[PHP-DEV] PHP 4.0 Bug #7733: missing /ext/informix/php_informix.h"
- In reply to: Derick Rethans: "Re: [PHP-DEV] Bizarre array key 'feature'?"
- Next in thread: Lars Torben Wilson: "Re: [PHP-DEV] Bizarre array key 'feature'?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Just to reinforce this answer. You should always quote your strings. The
only reason why unquoted names work is for backwards compatibility.
Actually these are treated as constants and only if the constant doesn't
exist will it be used as a string and I think it outputs an E_NOTICE to
tell you to fix it :)
Andi
At 11:53 AM 11/9/00 +0100, Derick Rethans wrote:
>Hi John,
>
>use $ourArray["default"]["a"] and error will probably go away.
>
>Derick
>
>John Parker wrote:
>
> > Hi, all.
> >
> > Hmm.. bit of a strange one, this... Is 'default' considered a reserved word
> > in the construction of muti-dimensional arrays?
> >
> > ie: The following code works.
> >
> > $ourArray[test][a] = true;
> > $ourArray[test][b] = false;
> > ...
> >
> > But the following fails (Parse error: parse error, expecting `']'') at the
> > first line containing the 'default' key.
> >
> > $ourArray[default][a] = true;
> > $ourArray[default][b] = false;
> >
> > Using PHP4.0.2 (yeah, I know I should probably upgrade).
> >
> > Thanks in advance,
> > JP.
> >
> > ------------------------------------------------------------------
> > John Parker email: jparker <email protected>
> > Internet Project Manager/Software Engineer web:www.itchannel.net
> > itCHANNEL International Ltd. tel: +44 (0) 1202 291939
> >
> > --
> > PHP Development Mailing List <http://www.php.net/>
> > To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
> > For additional commands, e-mail: php-dev-help <email protected>
> > To contact the list administrators, e-mail: php-list-admin <email protected>
>
>--
>Derick Rethans
>JDI Media Solutions
>
>H.v.Tussenbroekstraat 1
>6952 BL Dieren
>The Netherlands
>
>e-mail: d.rethans <email protected>
>http://www.jdimedia.nl/
>
>
>
>--
>PHP Development Mailing List <http://www.php.net/>
>To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
>For additional commands, e-mail: php-dev-help <email protected>
>To contact the list administrators, e-mail: php-list-admin <email protected>
--- Andi Gutmans <andi <email protected>> http://www.zend.com/-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Andi Gutmans: "Re: [PHP-DEV] Re: [PHP-QA] RFC:PHP Release Cycle"
- Previous message: hardy.muxel <email protected>: "[PHP-DEV] PHP 4.0 Bug #7733: missing /ext/informix/php_informix.h"
- In reply to: Derick Rethans: "Re: [PHP-DEV] Bizarre array key 'feature'?"
- Next in thread: Lars Torben Wilson: "Re: [PHP-DEV] Bizarre array key 'feature'?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

