OPcode dump of `ZEND_INIT_ARRAY` should not show `(packed)` if OP1 is unused
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 40.4k
- Forks
- 8.1k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 96
Description
Description
The ->extended_value (which holds the ZEND_ARRAY_NOT_PACKED flag) is completely ignored when OP1 is unused, making the (packed) indicator misleading, since the array will remain uninitalized.
The (packed) should either be removed or replaced by something like (uninit).
PHP Version
git master
Operating System
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked ext/standard/tests/array/array_map_foreach_optimization_001.phpt case around line 34 and inspect the opcode dump for ZEND_INIT_ARRAY. Trace the dump handling for an unused OP1 and verify that the (packed) indicator no longer misrepresents the uninitialized array state; update or add a PHPT expectation to show the corrected output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, php
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100