Skip to content

Stdlib: strlen() scalar operands — Zend string coercion (#11263) - #11269

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-11263-strlen-scalar-coerce
Jun 24, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/issue-11263-strlen-scalar-coerce

Conversation

@PurHur

@PurHur PurHur commented Jun 24, 2026

Copy link
Copy Markdown
Owner

Summary

Closes #11263

Verification

./script/docker-exec.sh -- bash -lc '
  source script/php-env.sh
  php test/repro/maintainer_gap_strlen_scalar_coerce.php
  php bin/vm.php test/repro/maintainer_gap_strlen_scalar_coerce.php
  php bin/vm.php test/compliance/cases/stdlib/strlen_scalar_coerce.phpt
  php bin/vm.php test/compliance/cases/stdlib/strlen_unit_enum_case.phpt
  php bin/compile.php -l test/repro/maintainer_gap_strlen_scalar_coerce.php
'

Made with Cursor

Coerce bool/int/float/null to string like Zend Z_PARAM_STR when the call
site is not strict_types; keep TypeError for enum/object/array and for
scalar operands under strict_types. Walk caller frames for strict_types
from closures (InternalStrictArg). JIT null coerces to length 0.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit df16f37 into master Jun 24, 2026
@PurHur
PurHur deleted the agent/issue-11263-strlen-scalar-coerce branch June 24, 2026 17:39
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: strlen() scalar operands — TypeError not Zend string coercion (ext/standard/string.c)

1 participant