Re: Re: problem with a global variable as class reference

From: Date: Sat, 15 Sep 2001 14:19:17 +0000
Subject: Re: Re: problem with a global variable as class reference
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-67449@lists.php.net to get a copy of this message
On Sat, Sep 15, 2001 at 04:11:47PM +0200, Wolfram Kriesing wrote : > > My answer may be not well thought but ... from my knowledge, > > problems with php-gtk you can't assign references to global vars > > because this particaular declared global variable is a local > > reference to the global var. > > as you say, i guess the "local reference to the global var" > is the problem > > at least i also forgot to define the "${$classNameY}" as global > if i do so then the following happens (see comments in code) > > class temp > { >   function temp() >   { >     global $curClass,${"y"}; > >     $curClass = &${"y"}; # this doenst work >     $curClass = ${"y"}; # this works, but it's not a reference :-( >   } > } > ------------- Good .. or bad. It's a Zend1 limitation. I'm sure Zend2 will remove this problem. > $curClass = &${"x"}; > $tempi = new temp(); Have you tried with creating a reference from the object upon instancing it? $foo = &new Object; ? - Markus -- Markus Fischer, http://guru.josefine.at/~mfischer/ EMail: mfischer@guru.josefine.at PGP Public Key: http://guru.josefine.at/~mfischer/C2272BD0.asc PGP Fingerprint: D3B0 DD4F E12B F911 3CE1 C2B5 D674 B445 C227 2BD0 -All your scripts are belong to Zend-

« previous php.general (#67449) next »