Re: foo[bar] _or_ foo['bar'] ?

From: Date: Tue, 13 Feb 2001 17:31:29 +0000
Subject: Re: foo[bar] _or_ foo['bar'] ?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-39442@lists.php.net to get a copy of this message
I'd really appreciate a clear statement whether to use better $foo = array('bar' => 'boing');
    doWhatSoEver($foo[bar]);
or $foo = array('bar' => 'boing');
    doWhatSoEver($foo['bar']);
I had heard someone on the list say that it's always best to use quotes, for the same reason as XHTML, where every value MUST have quotes. But honestly I've been using only NO-quotes all year and find it much easier to read. And NEVER any problem! Also makes it easier when you need to use an array variable inside a quoted string: print "Hello there $client[name]";

« previous php.general (#39442) next »