Re: [PHP] get an object property

2009-09-13 Thread Lars Torben Wilson
Tom Worster wrote: On 9/13/09 3:21 AM, "Lars Torben Wilson" wrote: On 9/12/09 9:50 AM, "Tom Worster" wrote: but let me give you a more different example: $a and $b are normally both objects, each with various members including a prop q, but sometimes $a is false. i want the q of $a if $a

Re: [PHP] get an object property

2009-09-13 Thread Tom Worster
On 9/13/09 3:21 AM, "Lars Torben Wilson" wrote: >> On 9/12/09 9:50 AM, "Tom Worster" wrote: >> >> but let me give you a more different example: >> >> $a and $b are normally both objects, each with various members including a >> prop q, but sometimes $a is false. i want the q of $a if $a isn't f

Re: [PHP] get an object property

2009-09-13 Thread Lars Torben Wilson
Tom Worster wrote: On 9/12/09 9:50 AM, "Tom Worster" wrote: On 9/12/09 1:32 AM, "Lars Torben Wilson" wrote: Tom Worster wrote: if i have an expression that evaluates to an object, the return value from a function, say, and i only want the value of one of the objects properti

RE: [PHP] get an object property

2009-09-12 Thread Jan Reiter
2, 2009 1:31 AM To: PHP General List Subject: [PHP] get an object property if i have an expression that evaluates to an object, the return value from a function, say, and i only want the value of one of the objects properties, is there a tidy way to get it without setting another variable? to

Re: [PHP] get an object property

2009-09-12 Thread Ralph Deffke
> echo a()['q']; // isn't? because this is simply not valid syntax for the INTERPRETER PHP while this > echo o()->q; can be interpreted because of the design of the interpreter. I can live with that. ralph_def...@yahoo.de "Tom Worster" wrote in message news:c6d13522.12422%...@thefsb.org... >

Re: [PHP] get an object property

2009-09-12 Thread Tom Worster
On 9/12/09 9:50 AM, "Tom Worster" wrote: > On 9/12/09 1:32 AM, "Lars Torben Wilson" wrote: > >> Tom Worster wrote: >>> if i have an expression that evaluates to an object, the return value from a >>> function, say, and i only want the value of one of the objects properties, >>> is there a tidy

Re: [PHP] get an object property

2009-09-12 Thread Tom Worster
On 9/12/09 1:32 AM, "Lars Torben Wilson" wrote: > Tom Worster wrote: >> if i have an expression that evaluates to an object, the return value from a >> function, say, and i only want the value of one of the objects properties, >> is there a tidy way to get it without setting another variable? >>

Re: [PHP] get an object property

2009-09-12 Thread Tom Worster
On 9/12/09 12:31 AM, "Paul M Foster" wrote: > On Fri, Sep 11, 2009 at 07:31:01PM -0400, Tom Worster wrote: > >> if i have an expression that evaluates to an object, the return value from a >> function, say, and i only want the value of one of the objects properties, >> is there a tidy way to get

Re: [PHP] get an object property

2009-09-11 Thread Lars Torben Wilson
Tom Worster wrote: if i have an expression that evaluates to an object, the return value from a function, say, and i only want the value of one of the objects properties, is there a tidy way to get it without setting another variable? to illustrate, here's something that doesn't work, but it wou

Re: [PHP] get an object property

2009-09-11 Thread Paul M Foster
On Fri, Sep 11, 2009 at 07:31:01PM -0400, Tom Worster wrote: > if i have an expression that evaluates to an object, the return value from a > function, say, and i only want the value of one of the objects properties, > is there a tidy way to get it without setting another variable? > > to illustr

Re: [PHP] get an object property

2009-09-11 Thread John Corry
Wouldn't it be $o[1]->a? J Corry Sent from my iPhone On Sep 11, 2009, at 7:31 PM, Tom Worster wrote: if i have an expression that evaluates to an object, the return value from a function, say, and i only want the value of one of the objects properties, is there a tidy way to get it withou

[PHP] get an object property

2009-09-11 Thread Tom Worster
if i have an expression that evaluates to an object, the return value from a function, say, and i only want the value of one of the objects properties, is there a tidy way to get it without setting another variable? to illustrate, here's something that doesn't work, but it would be convenient if i