Skip to content

Stdlib: PROFILE<8.4 strcspn empty mask stops at NUL (#27716) - #28952

Merged
PurHur merged 1 commit into
masterfrom
agent/advanced-stdlib-27716-strcspn-nul-profile
Aug 8, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/advanced-stdlib-27716-strcspn-nul-profile

Conversation

@PurHur

@PurHur PurHur commented Aug 8, 2026

Copy link
Copy Markdown
Owner

Summary

Closes #27716

php-src reference

Test plan

  • Repro:
    ./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && PHP_COMPILER_PROFILE=8.2 php bin/vm.php test/repro/issue_27716_strcspn_nul_profile.php && PHP_COMPILER_PROFILE=8.4 php bin/vm.php test/repro/issue_27716_strcspn_nul_profile.php && PHP_COMPILER_PROFILE=8.2 php bin/jit.php test/repro/issue_27716_strcspn_nul_profile.php && PHP_COMPILER_PROFILE=8.4 php bin/jit.php test/repro/issue_27716_strcspn_nul_profile.php'
    → 2/3 on 8.2, 4/3 on 8.4 (VM+JIT); default unset still 4/3 and strcspn("a\0b","")===3.
  • StrspnRuntimeShrinkTest OK.
  • Compliance guards: strcspn_empty_nul_profile82{,_jit}.phpt, strcspn_empty_nul_profile84.phpt.

Made with Cursor

Gate GH-12592 binary-safe empty-$characters length behind unset PROFILE /
PROFILE≥8.4; explicit PROFILE=8.2 matches Zend 8.2 NUL-stop on VM and JIT.

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.

Regression: strcspn("",) with NUL in haystack returns full length on PROFILE=8.2 — Zend stops at NUL (ext/standard/string.c)

1 participant