Skip to content

Stdlib: debug_zval_dump() stream resource — resource() line (#18419)#18423

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-18419-debug-zval-dump-stream
Jul 12, 2026
Merged

Stdlib: debug_zval_dump() stream resource — resource() line (#18419)#18423
PurHur merged 1 commit into
masterfrom
agent/issue-18419-debug-zval-dump-stream

Conversation

@PurHur

@PurHur PurHur commented Jul 12, 2026

Copy link
Copy Markdown
Owner

Summary

  • Route debug_zval_dump() through VmVarFormat::tryFormatDebugZvalDump() so stream handles print resource(id) of type (stream) refcount(n) like Zend/var_dump(), instead of object(Resource)#….
  • Add repro + compliance guard for open and closed php://memory streams.

Root cause

VmDebugZval lacked the resource branch that VmVarDump already shares via VmVarFormat.

php-src reference

  • ext/standard/var.czval_dump / debug_zval_dump
  • Zend/zend.czend_dump_var

Verification

php bin/vm.php test/repro/maintainer_gap_debug_zval_dump_stream.php
# resource(4) of type (stream) refcount(3)
# resource(4) of type (Unknown) refcount(3)

php bin/vm.php -r '$h=fopen("php://memory","r+"); debug_zval_dump($h);'
# resource(N) of type (stream) refcount(2)

./script/phpunit.sh --filter debug_zval_dump_stream
# OK (2 tests)

./script/phpunit.sh --filter 'debug_zval_dump_refcount|debug_zval_dump_string'
# compliance VM tests OK; AOT debug_zval_dump_string pre-existing fail on master (exit 134)

Closes #18419

Made with Cursor

Route debug_zval_dump through VmVarFormat resource formatting so stream
handles match Zend resource(id) of type (stream) refcount(n) output instead
of object(Resource) pretty-print.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stdlib: debug_zval_dump() stream resource — object(Resource) not resource() line (ext/standard/var.c)

1 participant