Skip to content

Stdlib: str_increment/str_decrement phantom function_exists on 8.2 reference (#16292) - #16297

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-16292-str-increment-phantom
Jul 5, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/issue-16292-str-increment-phantom

Conversation

@PurHur

@PurHur PurHur commented Jul 5, 2026

Copy link
Copy Markdown
Owner

Summary

  • Split supportsStrIncrement() (callable registration; forward PHP_COMPILER_PROFILE=8.3+ or stable 8.4+) from new advertisesStrIncrement() (function_exists / get_defined_functions gate).
  • Wire str_increment / str_decrement through BuiltinIntrospectionPolicy so default 8.4.0-dev reference profile matches Zend 8.2 (absent from introspection).
  • Add maintainer repro + update forward-profile compliance PHPT (--ENV-- PHP_COMPILER_PROFILE=8.3).

php-src reference: ext/standard/string.c — PHP_FUNCTION(str_increment) / PHP_FUNCTION(str_decrement) (PHP 8.3); introspection gate pattern from #11842 / #16086 (zend_thread_id, mb_str_pad).

Test plan

  • Issue repro (VM):
./script/docker-exec.sh -- bash -lc 'php bin/vm.php test/repro/maintainer_gap_str_increment_phantom_function_exists.php; echo exit:$?'
# ok / exit:0
  • Phantom compliance:
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit --filter "VMTest::testCases.*str_increment_phantom|VMTest::testCases.*php84_math_string_builtins_phantom"'
# OK (3 tests)
  • Forward profile still advertises + calls:
./script/docker-exec.sh -- bash -lc 'PHP_COMPILER_PROFILE=8.3 php bin/vm.php test/compliance/cases/stdlib/forward_profile_builtins.phpt'
# jv=yes / si=yes / sd=yes / b
  • Unit gates:
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit --filter "CompilerVersionGateTest::testSupportsStrIncrement|CompilerVersionGateTest::testAdvertisesStrIncrement|ForwardProfilePhantomIntrospectionTest::testStrIncrement"'
# OK (24 tests in str_increment filter set)

Closes #16292

Made with Cursor

…8.2 reference (#16292)

Split callable registration (supportsStrIncrement, forward PHP_COMPILER_PROFILE=8.3+)
from introspection advertisement (advertisesStrIncrement) so default 8.4.0-dev matches
Zend 8.2 function_exists/get_defined_functions while forward profile keeps callability.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit f3b4ab5 into master Jul 5, 2026
@PurHur
PurHur deleted the agent/issue-16292-str-increment-phantom branch July 5, 2026 04:38
PurHur added a commit that referenced this pull request Jul 5, 2026
#16354). (#16355)

Master's fast gate is red in a clean pinned container because three
generated docs went stale under recent merges:

- docs/capabilities.md + capability-comparison.html: drop the
  str_increment/str_decrement rows — f3b4ab5 (#16297) withholds them
  on the 8.4.0-dev reference profile, so a clean regen no longer emits
  them (rows were last synced before the gate change).
- docs/bootstrap-inventory.md + bootstrap-profile.json: method-count
  drift from the phpinfo/phpcredits CREDITS sections (#16353).
- docs/capabilities-syntax.md: asymmetric private(set) row flips
  AOT yes->no — honest probe result, real regression filed as #16354
  (AOT reads garbage and the set guard never fires).

All regenerated inside php-compiler:22.04-dev; check-generated-docs.sh
green afterwards.

Co-authored-by: PurHur <tedyyyyy@gmail.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.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: str_increment()/str_decrement() phantom — function_exists true on PHP 8.2 reference (ext/standard/string.c, re-#11842)

1 participant