I am running PHP 4.2.2 on Debian linux with apache 1.3.26
Jim
- Original Message -
From: Greg Beaver
To: Jim Lucas
Cc: [EMAIL PROTECTED]
Sent: Friday, August 01, 2003 3:02 PM
Subject: Re: [PHP] Re: Globals
What version of PHP are you running? I have PHP 4.3.2 on
: <[EMAIL PROTECTED]>
Sent: Friday, August 01, 2003 2:43 PM
Subject: Re: [PHP] Re: Globals
Jim,
My bad, I posted the wrong code. Try this instead to see the bug:
?>
run this code, don't read it, you will see output of bool(false),
bool(false)
However, the following code wor
;[EMAIL PROTECTED]>
Sent: Friday, August 01, 2003 2:43 PM
Subject: Re: [PHP] Re: Globals
> Jim,
>
> My bad, I posted the wrong code. Try this instead to see the bug:
>
> function not_super()
> {
> var_dump(isset($GLOBALS['GLOBALS']));
> return a
$key."=>(".$value.")\n";
}
?>
Jim Lucas
- Original Message -
From: "Greg Beaver" <[EMAIL PROTECTED]>
To: "Jim Lucas" <[EMAIL PROTECTED]>
Cc: "Leif K-Brooks" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Frida
value) {
echo $key."=>(".$value.")\n";
}
?>
Jim Lucas
- Original Message -
From: "Greg Beaver" <[EMAIL PROTECTED]>
To: "Jim Lucas" <[EMAIL PROTECTED]>
Cc: "Leif K-Brooks" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sen
n entry for GLOBALS
mine is located at #13
Jim Lucas
- Original Message -
From: "Greg Beaver" <[EMAIL PROTECTED]>
To: "Leif K-Brooks" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, August 01, 2003 12:45 PM
Subject: Re: [PHP] Re: Globals
EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, August 01, 2003 12:45 PM
Subject: Re: [PHP] Re: Globals
> Try this code:
>
> function blah() {
> var_dump($GLOBALS['GLOBALS']);
>
> }
>
> blah();
> ?>
>
> It appears that in a
Try this code:
}
blah();
?>
It appears that in a function scope, it doesn't. This is definitely a
bug, I'll post it if it hasn't already been noticed.
Greg
Leif K-Brooks wrote:
Greg Beaver wrote:
$GLOBALS does not contain a reference to itself
Yes it does. I just ran the following, and I
Greg Beaver wrote:
$GLOBALS does not contain a reference to itself
Yes it does. I just ran the following, and I got "Greg is wrong."
--
The above message is encrypted with double rot13 encoding. Any unauthorized attempt
to decrypt it will be prosecuted to the full extent of the law.
--
PHP G
> Is there an easier way than having to manually place "global"
> in each function...??
It's not that hard :)
> Other than passing by parameter?
>
> Like is it possible to actually declare var's in PHP
> as global?
No. Consider arrays, constants, extract(), etc.
Regards,
Philip
--
PHP
Basically I use the MVC (Model View Controller) architecture when building my php
scripts. So all of my logic is
handled by a controller which calls methods on functions,
that way the php scritps that are used to display forms, tables etc. have little to no
business logic to them at all.
Now in
11 matches
Mail list logo