|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2000-08-18 11:06 UTC] waldschrott@php.net
It would be very, very helpful if we could *disable* reference resolution in var_dump() output, working with circular references and then trying a var_dump() on any involved object results in a really big mess, I killed my browser after it grew up to 250Megs. It?s really handy that var_dump() recognizes if it?s a variable or not (by prepending &) and I can imagine that profit supercedes the efforts to implement this greatly. that applies to print_r() and similar functions too PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 04:00:01 2025 UTC |
If someone takes the task designing a new svar_dump() or similar (custom_dump()), we could add two parameters. param 1) steps, how many steps to resolve, unset=all (as it is currently),1=one level, 2=two levels etc. we would catch the issue that var_dump() produces never ending output with that too, but It?ll be even better to have both, thus... param 2) do not resolve references That?s significant added value and could make debugging a lot easier.... example step=2,no_resolve=TRUE object(a)(3) { ["a"]=> int(0) ["b"]=> array(3) { ["a"]=> array(24) ["b"]=> array(14) ["a"]=> array(7) } ["c"]=> &object(circular) (20) } // "c" does not get expanded, because of no_resolve... example step=1,no_resolve=FALSE object(a)(3) { ["a"] int(0) ["b"]=> array(3) ["c"]=> &object(circular) (1) { ["x"] => &object(a) (3) } } example step=0,no_resolve=TRUE // no resolve doesn?t matter here object(a)(3) { ["a"] int(0) ["b"]=> array(3) ["c"]=> &object(circular) (1) } Please comment, If anything thinks that?s a good/bad idea...