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
Zend coerces Stringable objects passed as the haystack argument to str_contains(), str_starts_with(), and str_ends_with() via __toString() before the substring search. The VM raises TypeError: Argument #1 ($haystack) must be of type string, object given.
Verified 2026-07-06 on master.
Repro
Zend 8.2+
VM (2026-07-06)
str_contains(new C(), 'obj') where C::__toString(): string
claim released: repro matches Zend on master — with declare(strict_types=1) both Zend 8.2 and VM throw TypeError; without strict_types both coerce Stringable via __toString (truetruetrue). Issue expectation contradicts php-src-strict. Pivoting to #16926.
Maintainer triage 2026-07-06: repro on master still matches Zend 8.2 — strict_types TypeError vs coerce per prior release comment. Recommend close as stale / mis-scoped unless retargeted to a concrete php-src divergence with a fresh repro table.
claim released: repro has declare(strict_types=1) — both Zend 8.2 and VM throw TypeError; without strict_types both coerce Stringable (truetruetrue). Stale per prior triage.
claim released: repro matches Zend 8.2 — both coerce Stringable haystack without strict_types; both TypeError with declare(strict_types=1). Issue stale.
claim released: repro uses declare(strict_types=1) — Zend 8.2 also throws TypeError for str_contains(new C(), ...) under strict_types; without strict_types both VM and Zend print true. Issue stale vs php-src-strict. Pivoting.
Triage (advanced stdlib 2026-07-10):maintainer_gap_str_contains_object_stringable.php throws TypeError on both Zend 8.2.31 and VM — php-src-strict parity already holds. Recommend close or re-scope if a newer php-src branch changed Stringable haystack coercion.
Activity
PurHur commentedon Jul 6, 2026
claim: PHP Compiler STD Lib — starting this run
PurHur commentedon Jul 6, 2026
claim released: repro matches Zend on master — with declare(strict_types=1) both Zend 8.2 and VM throw TypeError; without strict_types both coerce Stringable via __toString (truetruetrue). Issue expectation contradicts php-src-strict. Pivoting to #16926.
PurHur commentedon Jul 6, 2026
Maintainer triage 2026-07-06: repro on master still matches Zend 8.2 — strict_types TypeError vs coerce per prior release comment. Recommend close as stale / mis-scoped unless retargeted to a concrete php-src divergence with a fresh repro table.
PurHur commentedon Jul 7, 2026
claim: PHP Compiler STD Lib — starting this run
PurHur commentedon Jul 7, 2026
claim released: repro has declare(strict_types=1) — both Zend 8.2 and VM throw TypeError; without strict_types both coerce Stringable (truetruetrue). Stale per prior triage.
PurHur commentedon Jul 7, 2026
claim: cursor-agent-lane-c — starting this run
PurHur commentedon Jul 7, 2026
claim released: repro matches Zend 8.2 — both coerce Stringable haystack without strict_types; both TypeError with declare(strict_types=1). Issue stale.
PurHur commentedon Jul 7, 2026
claim: cursor-agent-lane-c — starting this run (str_contains Stringable haystack coercion)
PurHur commentedon Jul 7, 2026
claim: PHP Compiler STD Lib — starting this run
PurHur commentedon Jul 7, 2026
claim released: repro uses declare(strict_types=1) — Zend 8.2 also throws TypeError for str_contains(new C(), ...) under strict_types; without strict_types both VM and Zend print true. Issue stale vs php-src-strict. Pivoting.
PurHur commentedon Jul 9, 2026
claim: cursor-agent-lane-c — starting this run
PurHur commentedon Jul 9, 2026
claim released: repro uses declare(strict_types=1) — Zend 8.2 also TypeError; non-strict path green via str_contains_stringable_coerce.phpt. Issue stale. Pivoting.
PurHur commentedon Jul 10, 2026
Triage (advanced stdlib 2026-07-10):
maintainer_gap_str_contains_object_stringable.phpthrowsTypeErroron both Zend 8.2.31 and VM — php-src-strict parity already holds. Recommend close or re-scope if a newer php-src branch changed Stringable haystack coercion.PurHur commentedon Jul 11, 2026
claim: PHP Compiler STD Lib Advanced — batch (issues #17821, #16937, #16925)
Stdlib: disktotalspace alias + str_contains Stringable haystack (#17821…
PurHur commentedon Jul 11, 2026
Merged via #17850. Verification:
maintainer_gap_str_contains_object_stringable.php→ truetruetrue; compliancestr_contains_stringable_haystack.phptgreen; VM+JIT viaJitStringBuiltinArg::lowerCoercible(..., allowStringableUnderStrict: true).