RE: [PHP] Re: Cronjob
| From: | Ford, Mike [LSS] | Date: | Thu, 26 Sep 2002 13:26:12 +0000 |
| Subject: | RE: [PHP] Re: Cronjob | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-117718@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: Daren Cotter [mailto:daren_cotter@yahoo.com]
> Sent: 25 September 2002 20:11
I know your real problem has been solved, but this might save you from wasting time inspecting the
wrong line of code one day:
> There isn't even a line 3 in the script:
Errr...
1 <?php
2 var_dump($argv);
3 var_dump($GLOBALS);
4 ?>
The error you got is because the $GLOBALS array is itself global, so contains a reference to itself,
which could cause infinite looping if PHP didn't detect it and throw that error!
Incidentally, both var_dump() and print_r() output useful information about what's in a
variable, but in both cases the output is formatted using regular newlines and spaces, with no HTML
layout, so for large arrays such as $GLOBALS it's best to do something like:
echo "<pre>";
print_r($GLOBALS);
echo "</pre>";
The output from this is actually formatted rather nicely, and is quite easy to read (and can be very
informative!).
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.ford@lmu.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211