Re: RE: A slightly amusing, though mostly dangerous, endless loop
| From: | Plutarck | Date: | Tue, 17 Apr 2001 15:58:30 +0000 |
| Subject: | Re: RE: A slightly amusing, though mostly dangerous, endless loop | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-48994@lists.php.net to get a copy of this message | ||
It's automatically enabled, and I don't think it's available for disabling.
I recall hearing something about a feature being added to PHP to help
prevent infinate loops, and it apparently works with print_r.
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.Greig@brann.com> wrote in message
news:5CEAD14A5163D211A21B0008C724629401C8D7F0@ciren-mbx1.BRANN.CO.UK...
> Is the anti-recursion feature you mention automatically activated or do
you need to configure it to take effect?
>
> 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:aemuli@spamclause-yahoo.com]
> Sent: 14 April 2001 12:59
> To: php-general@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-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>