You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
str_contains(), str_starts_with(), and str_ends_with() accept Stringable object operands on VM (via implicit __toString coercion) and return true. Zend PHP 8.2+ throws TypeError — these builtins use typed string parameters and do not coerce objects, even when __toString() is defined.
Distinct from #8825 (enum case operands) and from legacy builtins that still coerce __toString (see #14661 strcmp / #14662 str_replace family).
Merged via #14664 — str_contains/str_starts_with/str_ends_with VM+JIT now TypeError on Stringable operands; repro maintainer_gap_str_contains_stringable_typeerror.php prints ok.
Activity
PurHur commentedon Jul 1, 2026
claim: PHP Runtime → PHP — batch (issues #14660, #14661, #14662, #14663)
Fix str_contains family TypeError for Stringable operands (#14660). (#…
PurHur commentedon Jul 1, 2026
Merged via #14664 — str_contains/str_starts_with/str_ends_with VM+JIT now TypeError on Stringable operands; repro
maintainer_gap_str_contains_stringable_typeerror.phpprints ok.