|
Posted by Rik Wasmus on 11/21/07 00:44
On Tue, 20 Nov 2007 23:03:04 +0100, Steve <no.one@example.com> wrote:
> "Rik Wasmus" <luiheidsgoeroe@hotmail.com> wrote in message
> news:op.t13ogdmp5bnjuv@metallium.lan...
> On Tue, 20 Nov 2007 17:08:14 +0100, Steve <no.one@example.com> wrote:
>> "MW" <bulk@spandan.com> wrote in message
>>> class Cls {
>>> public $var_a;
>>> public $var_b;
>>> }
>>>
>>> $x=3Dnew Cls;
>>> $y=3D"var_a";
>>> $x->$y=3D"Hello"; // want this to translate to $x->var_a=3D"Hello"
>>>
>>> I tried using $x->{$y}=3D"Hello" but that did not work either...
>>
>> try:
>> $x->$$y =3D 'hello'
>> or:
>> $x->${$y} =3D 'hello'
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>
>> Which would require you have a $var_a set outside the class:
>>
>> $y=3D"var_a";
>> $var_a =3D "foo";
>
> which is the exact thing his example shows.
No, it isn't
>> This: $x->$$y =3D 'hello'
>> Is this: $x->$var_a =3D 'hello'
>> Is this: $x->foo =3D 'hello'
>
>> As the OP allready stated, his original code just plainly works.
>
> right...but please note, i responded before he remarked that his code =
=
> *did*
> work. so, to me, it makes no difference.
Euhm, you mean you were just wildly guessing? The correct answer should =
=
have been 'it does work'.
> btw, rik...PLEASE set your newreader to PROPERLY mark-up/indent your
> replies. it's a pain in the ass to respond to you since i have to =
> manually
> put in > for everything you type...just so everyone can tell where my
> response goes in all that mess.
If your newsreader cannot cope with format=3Dflowed (From the header: =
'Content-Type: text/plain; format=3Dflowed; delsp=3Dyes; charset=3Diso-8=
859-15') =
it's either ancient or just plainly sucks. Please upgrade (OEQuotefix? =
<http://www.snapfiles.com/get/oequotefix.html>, a quick test here shows =
it =
whips MSOE rightly into shape).
Please look at the source or my post, and notice that my message is =
actually fullly compliant. Check the relevant RFC's.
-- =
Rik Wasmus
Navigation:
[Reply to this message]
|