Summary
str_decrement('a') must return ` (single-byte decrement below 'a'). This compiler throws:
Error: str_decrement(): Argument #1 ($string) "a" is out of decrement range
Multi-character strings like 'aa' → 'z' and 'ba' → 'az' work; only single lowercase 'a' is wrong.
Repro
./script/docker-exec.sh -- php bin/vm.php test/repro/maintainer_gap_str_decrement_single_a.php
Zend (PHP 8.3+): prints ` and exits 0.
This compiler: Error: … "a" is out of decrement range, exit 1.
php-src reference
ext/standard/string.c — php_str_decrement() single-character path decrements 'a' to `
Implementation (PHP-in-PHP)
ext/standard/VmString.php — strDecrement() carry/trim logic mishandles lone 'a' (wraps to 'Z' then rejects). Match php-src per-byte decrement for length-1 strings.
ext/standard/str_decrement.php + JIT lowering if present.
Done when (php-src-strict)
php bin/vm.php test/repro/maintainer_gap_str_decrement_single_a.php exits 0.
- Compliance guard for
str_decrement('a') === `.
Related: #4218, #9277 (other str_increment/decrement edges).
Refs #1492
Summary
str_decrement('a')must return`(single-byte decrement below'a'). This compiler throws:Multi-character strings like
'aa'→'z'and'ba'→'az'work; only single lowercase'a'is wrong.Repro
Zend (PHP 8.3+): prints
`and exits 0.This compiler:
Error: … "a" is out of decrement range, exit 1.php-src reference
ext/standard/string.c—php_str_decrement()single-character path decrements'a'to`Implementation (PHP-in-PHP)
ext/standard/VmString.php—strDecrement()carry/trim logic mishandles lone'a'(wraps to'Z'then rejects). Match php-src per-byte decrement for length-1 strings.ext/standard/str_decrement.php+ JIT lowering if present.Done when (php-src-strict)
php bin/vm.php test/repro/maintainer_gap_str_decrement_single_a.phpexits 0.str_decrement('a')===`.Related: #4218, #9277 (other str_increment/decrement edges).
Refs #1492