Re: [PHP] limit to var_dump?

2010-04-17 Thread Michiel Sikma
On 16 April 2010 16:15, Ashley Sheridan  wrote:

> I'm seeing some strange behaviour with var_dump. Is there a limit to how
> many levels deep that var_dump can display?
>
> -snip-
>
> However, when I var_dump the top-most object (the Gantt object) the
> predecessors array for Gantt_Task 1.2 just shows as '...'. If I var_dump
> that particular object, I can see that the correct array element does
> exist.
>
> Is this just a random bug I've found, or is there an intended limit to
> how complex and deep var_dump can go? Would it have anything to do with
> the fact that Gantt contains multiple instances of the Gantt_Task
> object?
>
>
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
There's a limit to var_dump if you have Xdebug installed. See the Xdebug
site:

http://www.xdebug.org/docs/display

On another note, iirc var_dump itself can detect and prevent infinite
recursion.

Michiel


Re: [PHP] limit to var_dump?

2010-04-16 Thread Peter Lind
There's a limit to how deep var_dump goes, at least if you're using
xdebug. Compare the output with that of print_r which is not limited
in the same way.

On 16 April 2010 16:15, Ashley Sheridan  wrote:
> I'm seeing some strange behaviour with var_dump. Is there a limit to how
> many levels deep that var_dump can display?
>
> Basically, my object looks like this:
>
> object(Gantt)[1]
>  public 'tasks' =>
>    array
>      1 =>
>        object(Gantt_Task)[2]
>          public 'name' => string 'task 1' (length 6)
>          public 'predecessors' =>
>            array
>              ...
>      1.1 =>
>        object(Gantt_Task)[3]
>          public 'name' => string 'task 1.1' (length 8)
>          public 'predecessors' =>
>            array
>              ...
>      1.2 =>
>        object(Gantt_Task)[4]
>          public 'name' => string 'task 1.2' (length 8)
>          public 'predecessors' =>
>            array
>              '1.1' => string 'f2s' (length 3)
>
>
> (full dump shortened, but it's no more than 4x the size of this output
> above, and the objects contain only short strings, small numbers and
> arrays of short strings and small numbers)
>
> However, when I var_dump the top-most object (the Gantt object) the
> predecessors array for Gantt_Task 1.2 just shows as '...'. If I var_dump
> that particular object, I can see that the correct array element does
> exist.
>
> Is this just a random bug I've found, or is there an intended limit to
> how complex and deep var_dump can go? Would it have anything to do with
> the fact that Gantt contains multiple instances of the Gantt_Task
> object?
>
>
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



-- 

WWW: http://plphp.dk / http://plind.dk
LinkedIn: http://www.linkedin.com/in/plind
Flickr: http://www.flickr.com/photos/fake51
BeWelcome: Fake51
Couchsurfing: Fake51


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php