Skip to content

Stdlib: str_increment()/str_decrement() phantom — function_exists true on PHP 8.2 reference (ext/standard/string.c, re-#11842) #16292

Description

@PurHur

Category

stdlib · php-src-strict

Problem

PHP 8.3+ str_increment() / str_decrement() must be absent from function_exists() and get_defined_functions()['internal'] on the default PHP 8.2 reference profile (Zend 8.2 in Docker). The VM advertises both on the 8.4.0-dev line via CompilerVersion::supportsStrIncrement() / advertisesBuiltinSince('8.3.0'), diverging from php-src-strict reference behavior (same class of bug fixed for zend_thread_id() in #11842).

Repro Zend 8.2 (2026-07-05) VM (2026-07-05)
function_exists('str_increment') false true
in_array('str_increment', get_defined_functions()['internal']) false true

Callable under forward profile (PHP_COMPILER_PROFILE=8.3 / stable 8.4+) is fine once advertisement matches Zend for that profile.

php-src reference

PHP implementation target

Repro

./script/docker-exec.sh -- bash -lc 'php test/repro/maintainer_gap_str_increment_phantom_function_exists.php; echo exit:$?'
./script/docker-exec.sh -- bash -lc 'php bin/vm.php test/repro/maintainer_gap_str_increment_phantom_function_exists.php; echo exit:$?'

Done when

  • Repro ok on VM with default/php-src reference profile (8.2)
  • function_exists / get_defined_functions true when PHP_COMPILER_PROFILE=8.3+ or stable 8.4 runtime
  • Compliance guard under test/compliance/cases/string/
  • php-src-strict; no php-compiler-strict shortcut

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:vmVirtual machineenhancementNew feature or requestimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimphase-4:stdlibPhase 4 – stdlib for web appsstdlib

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions