Skip to content

Language: magic __get/__set pre/post dec no Undefined property (#32014) - #32023

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-32014-magic-prop-dec-no-undef-warn
Aug 18, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/issue-32014-magic-prop-dec-no-undef-warn

Conversation

@PurHur

@PurHur PurHur commented Aug 18, 2026

Copy link
Copy Markdown
Owner

Summary

php-src reference

  • Zend/zend_object_handlers.c — magic read/write for inc/dec
  • Zend/zend_vm_def.hZEND_PRE_DEC_OBJ, ZEND_POST_DEC_OBJ

Verification

./script/docker-exec.sh -- bash -lc 'php bin/vm.php test/repro/maintainer_gap_magic_prop_dec.php'
# dec=0

./script/docker-exec.sh -- bash -lc 'php bin/vm.php test/repro/maintainer_gap_magic_prop_postdec.php'
# postdec=0

./script/docker-exec.sh -- bash -lc 'php bin/jit.php test/repro/maintainer_gap_magic_prop_dec.php'
# dec=0

./script/docker-exec.sh -- bash -lc 'php bin/jit.php test/repro/maintainer_gap_magic_prop_postdec.php'
# postdec=0

./script/phpunit.sh --filter 'MagicPropDecNoUndefWarn|MagicPropIncNoUndefWarn'
# OK (4 tests, 4 assertions)

Not covered: AOT magic property inc/dec value correctness (pre-existing gap — AOT returns stale inc=1/dec=1; tracked separately in AOT inventory).

Closes #32014

Made with Cursor

Repro scripts and VM/JIT .phpt lock in silent __get/__set behavior for
--$obj->n and $obj->n-- covered by the #31992 inc/dec guard in lib/VM.php
and lib/JIT.php; register inc/dec suites in phpunit.xml.dist.

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.

Language: $obj->n-- / --$obj->n with __get/__set warns Undefined property — Zend silent magic (re-#31992, zend_object_handlers.c)

1 participant