Skip to content

Close #137: pre/post increment/decrement (lint + compliance)#1146

Merged
PurHur merged 1 commit into
masterfrom
issue-137-pre-post-inc
May 23, 2026
Merged

Close #137: pre/post increment/decrement (lint + compliance)#1146
PurHur merged 1 commit into
masterfrom
issue-137-pre-post-inc

Conversation

@PurHur
Copy link
Copy Markdown
Owner

@PurHur PurHur commented May 23, 2026

Summary

  • php-cfg already lowers ++/-- to assign + arithmetic; VM/JIT produce Zend-compatible pre/post values (e.g. 112 for ++$i, $i, $i++).
  • Remove IncrementDetector false positives and UnsupportedRegistry mappings so phpc lint accepts increment syntax.
  • Add VM/JIT compliance tests (pre_post_inc*, pre_post_dec*) and drop IncrementDetector.php from bootstrap AOT lint targets.

Test plan

  • ./script/docker-ci-local.sh fast --filter 'pre_post_inc|pre_post_dec|testLintPre|testLintPost|UnsupportedRegistryTest|testPrePostIncrement'
  • Manual: php bin/vm.php -r '$i=0; echo ++$i, $i, $i++;'112

Closes #137

Made with Cursor

php-cfg already lowers ++/-- to assign+arithmetic; remove the AST-only
IncrementDetector false positives, drop registry mappings, and add VM/JIT
compliance tests for Zend-compatible pre/post inc/dec semantics.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur PurHur merged commit 84e35f9 into master May 23, 2026
1 check failed
@PurHur PurHur deleted the issue-137-pre-post-inc branch May 23, 2026 18:42
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: Pre/post increment and decrement (++/--)

1 participant