Re: [Phpslash-devel] Very minor debugging suggestion for lib.resources.php
Brought to you by:
joestewart,
nhruby
From: Matthew L. <lei...@ma...> - 2003-07-10 19:44:39
|
Hi, Still unpacking but checking e-mail... On Thu, 10 Jul 2003, Joe Stewart wrote: > On Thu, Jul 10, 2003 at 10:57:39AM -0400, Mike Gifford wrote: > > Howdy, > > [snip!] > > You can't pass arrays to the debug function very well.. I suppose you > > could serialize them so > > debug('List of classes',serialize(get_declared_classes())); > > > > In anycase just a thought.. > > > > Hey Mike, > > debug() should have no trouble outputting arrays. This works fine for me: > > debug("declared_classes", get_declared_classes()); I agree. debug() got rewritten for 0.7 to recurse through arrays and objects. > What is the value of debug.max_recursion_level in config.ini? > > debug.max_recursion_level = 10 This was a guard against circular references. Consider: $a = new Parent; $b = new Child; $a->children[] =& $b; $b->parent =& $a; debug("a",$a); This would go on indefinitely without either (a) a check for circularity or (b) a maximum level to recurse to. I didn't really know how to do (a) so I built in (b). I believe if you set $_PSL['debug.max_recursion_level'] to something negative then you can get arbitrary recursion (with no circularity checks). But anyway, the array returned from get_defined_classes should only be one-dimensional, so 10 is fine for the purpose! --Matt ---------------------------------------------------------------- Matthew Leingang 617/495-2171 Harvard University lei...@ma... Department of Mathematics "This signature needs no quote." |