-
Notifications
You must be signed in to change notification settings - Fork 7.9k
ext/standard: make debug_zval_dump() output whether the array is packed #12641
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Is there documentation somewhere when arrays are packed/not packed and when/which/how much impact it has? edit: after some research I found
is this still accurate? |
This comment was marked as off-topic.
This comment was marked as off-topic.
It's literally the purpose of this function. Quoting the manual:
|
639098a
to
4cc3fd0
Compare
Changed "packed array" to "array packed" to be consistent with other attributes. |
4cc3fd0
to
600a8eb
Compare
@@ -84,7 +84,7 @@ opcache.enable=0 | |||
require_once 'clean_table.inc'; | |||
?> | |||
--EXPECTF-- | |||
array(7) refcount(2){ | |||
array(7) packed refcount(2){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just as an idea which could be also used in regular var_dump()
array(7) packed refcount(2){ | |
list(7) refcount(2){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had thought about something like this, but decided that it would be confusing because the type remains IS_ARRAY at all times.
Sorry. Confused it with var_dump(). Then, it's completely fine. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to me, can you add an entry to UPGRADING/NEWS ?
600a8eb
to
f28b28e
Compare
Done. |
Thank you! |
Packed arrays can make a lot of difference, however lots of developers simply don't
know about them or when an array can be packed. Thus I propose to make this
information available to userspace, but as a debug tool, not something like array_is_list().