This error with print_r is documented in the manual, but would still be (have been) an easy trap to fall into!
-----Original Message-----
From: Plutarck [mailto:aem...@spamclause-yahoo.com]
Sent: 14 April 2001 12:59
To: php-g...@lists.php.net
Subject: A slightly amusing, though mostly dangerous, endless loop
This is a bug which was apparently fixed in v 4.0.4pl1 at least, but it
still present in 4.0.3
I just found it kind of amusing and it makes a nice warning.
Consider this:
print_r($GLOBALS);
That's it. It prints all the variables available, however part of it is an
array called GLOBALS. Which then prints all available variables, including
an array called GLOBALS...
And it will continue until you hit the Stop button or until the script times
out. But if you have ignore.user.abort on, it will continue till it times
out. If you've screwed with your scripts timeout settings...
...so be wary of that, and ensure you don't try and print out the variables
available in GLOBALS in older versions of PHP. It was fixed with the
anti-recursion feature, which automatically breaks endless loops.
--
Plutarck
Should be working on something...
...but forgot what it was.
**************************************************************************
Any opinions expressed in this email are those of the individual and
not necessarily the Company. This email and any files transmitted with
it, including replies and forwarded copies (which may contain alterations)
subsequently transmitted from the Company, are confidential and solely for
the use of the intended recipient. If you are not the intended recipient
or the person responsible for delivering to the intended recipient, be
advised that you have received this email in error and that any use is
strictly prohibited.
**************************************************************************
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general...@lists.php.net
For additional commands, e-mail: php-gene...@lists.php.net
To contact the list administrators, e-mail: php-lis...@lists.php.net
It should probably be listed more prominately and in any place where
$GLOBALS is mentioned.
The first time I saw it I was thinking, "Geeze, this page sure is taking a
long time to load...and why are so many variables available on this site..."
--
Plutarck
Should be working on something...
...but forgot what it was.
""Greig, Euan"" <Euan....@brann.com> wrote in message
news:5CEAD14A5163D211A21B...@ciren-mbx1.BRANN.CO.UK...