Re: object literals

From: Date: Sun, 03 May 2009 00:09:40 +0000
Subject: Re: object literals
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-292227@lists.php.net to get a copy of this message
On 5/2/09 6:45 AM, "Robert Cummings" <robert@interjinn.com> wrote: > It's not what I want, I'm not the original poster. as op, i think i'm going to stick with the cast. but it's been an interesting thread and i learned some useful things. > Regardless though, it > comes down to the preference of the developer. It can certainly be > simpler to type: > > $obj->blah->bleh->bluh; > > than to type: > > $obj['blah']['bleh']['blug']; exactly. and i dislike typing "SELECT col FROM tab WHERE a=" . $a['blah'] . " AND ... " or even "SELECT col FROM tab WHERE a={$a['blah']} AND ... " when i could type "SELECT col FROM tab WHERE a=$a->blah AND ... " which is also easier to read. i'm really lazy about typing.

« previous php.general (#292227) next »