4, 2002 9:29 PM
Subject: Re: [PHP] OOP-related question
> Ok, I combined both, your tip and Brent's, now I have the following
> error, with the following code:
>
> Fatal error: Cannot pass parameter 1 by reference in
> /home/shadowlight/public_html/test/libs/global.lib.php on line 2
Ok, I combined both, your tip and Brent's, now I have the following
error, with the following code:
Fatal error: Cannot pass parameter 1 by reference in
/home/shadowlight/public_html/test/libs/global.lib.php on line 296
code:
function load(&$class){
global $$class;
$$class = new $class;
I think it is working, but you are not seeing anything because all the
"variables" and objects that are declared in your classes are destroyed
once the function exits (out of scope?). I just finished reading up on
this, but I think you want to look into passing data by reference
instead of valu
Hello,
Adding the following as the first line of overall->load() should solve your
problem.
global $$class;
HTH,
Danny.
- Original Message -
From: "Tularis" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, November 14, 2002 8:18 PM
Subject: [PHP] OOP-related question
> Hey
On Mon, 29 Apr 2002 [EMAIL PROTECTED] wrote:
> I include this in my class-function, which works fine for the most
> variables but $SERVER_ADDR It seems that I cannot get these variable in
> the function of my class so I have to pass them as argument to the
> function. I have made an init() functio
5 matches
Mail list logo