limit to var_dump?
am 16.04.2010 16:15:05 von Ashley Sheridan
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
Re: limit to var_dump?
am 16.04.2010 16:26:31 von 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' =3D>
> Â Â array
> Â Â Â 1 =3D>
> Â Â Â Â object(Gantt_Task)[2]
> Â Â Â Â Â public 'name' =3D> string 'task 1' (len=
gth 6)
> Â Â Â Â Â public 'predecessors' =3D>
> Â Â Â Â Â Â array
> Â Â Â Â Â Â Â ...
> Â Â Â 1.1 =3D>
> Â Â Â Â object(Gantt_Task)[3]
> Â Â Â Â Â public 'name' =3D> string 'task 1.1' (l=
ength 8)
> Â Â Â Â Â public 'predecessors' =3D>
> Â Â Â Â Â Â array
> Â Â Â Â Â Â Â ...
> Â Â Â 1.2 =3D>
> Â Â Â Â object(Gantt_Task)[4]
> Â Â Â Â Â public 'name' =3D> string 'task 1.2' (l=
ength 8)
> Â Â Â Â Â public 'predecessors' =3D>
> Â Â Â Â Â Â array
> Â Â Â Â Â Â Â '1.1' =3D> 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
>
>
--=20
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
Re: limit to var_dump?
am 17.04.2010 12:03:24 von Michiel Sikma
--0016e6d77ecba4655e04846bd6fa
Content-Type: text/plain; charset=UTF-8
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
--0016e6d77ecba4655e04846bd6fa--