Jump to content

Show more than 100 items of arrays (and other iterables)


Ivan Gretsky
 Share

Recommended Posts

1 minute ago, bernhard said:

did dbd() not work for you?

It won't fix this issue though because the "big" version of those methods only increases the "maxDepth" and "maxLength" attributes. It doesn't support increasing the "maxItems". In fact maxItems is new to the Tracy core in 2.8 and 2.9. In 2.7 and earlier there was no limit to the number of items so this setting wasn't needed as all items would have been dumped.

Link to comment
Share on other sites

Just now, bernhard said:

Ok strange because I tested it today myself and it just worked for 110 items, so I thought it works as expected?! ?‍♂️

Are you sure it's actually showing all 110? It shows the total count, but the not all items are shown - at least that's what I am seeing.

Link to comment
Share on other sites

Interesting - I am seeing that also with that example, but definitely items are truncated to 100 when dumping $config->paths and if I force Tracy to use 2.7 then it's no longer truncated.

I don't know why there is a difference - maybe there is some logic that controls when the $maxItems of 100 is implemented?

Link to comment
Share on other sites

18 minutes ago, adrian said:

I don't know why there is a difference - maybe there is some logic that controls when the $maxItems of 100 is implemented?

Well that's two different dumps... one is dumping the array and one is dumping an object that has an array inside the data property!

d($config->paths);
d($config->paths->data);

JrOygVq.png

Personally I think that behaviour is good ? 

  • Like 2
Link to comment
Share on other sites

Good catch - thanks for noticing that - I'm not on it this morning apparently :)

Well @Ivan Gretsky - at least using $config->paths->data should work for you.

I'll still keep an eye on that $maxItems setting and implement when available and see if it handles that other situation.

 

  • Like 2
Link to comment
Share on other sites

  • 3 weeks later...

@Ivan Gretsky - new version with this is now available.

Note that in the end I didn't actually need the update to the Tracy core because I am actually overwriting their dump and barDump methods anyway - sorry I didn't notice that sooner.

Let me know if you notice any problems - this hasn't had a lot of testing yet.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...