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
mb_strlen() rejects enum case operands with LogicException (mb_strlen() only supports strings in this compiler build) instead of Zend’s TypeError (Argument #1 ($string) must be of type string, … given). This is separate from #5524 (ext/standard string.c builtins).
Category
stdlib· php-src-strictProblem
mb_strlen()rejects enum case operands withLogicException(mb_strlen() only supports strings in this compiler build) instead of Zend’sTypeError(Argument #1 ($string) must be of type string, … given). This is separate from #5524 (ext/standardstring.cbuiltins).php-src reference
ext/mbstring/mbstring.c—PHP_FUNCTION(mb_strlen)/Z_PARAM_STRZend/zend_enum.c— enum cases are objects, not stringsRepro
test/repro/maintainer_mb_strlen_enum.php:TypeError: mb_strlen(): Argument #1 ($string) must be of type string, Es givenLogicException: mb_strlen() only supports strings in this compiler buildImplementation hints
ext/mbstring/mb_strlen.php— useVmString::coerceStringBuiltinArg()/EnumCaseSupport::rejectEnumCaseOperand()like ext/standard string builtins (Stdlib: hash()/hash_hmac()/md5()/sha1()/crc32() — enum case operands must TypeError (ext/hash, ext/standard) #5780 pattern).ext/mbstring/JitMbStrlen.phpwhen touching JIT.Done when
TypeErrormatching Zend for enum case operand (notLogicException)TypeErrorwhen native path existstest/compliance/cases/stdlib/mb_strlen_enum_typeerror.phpt./script/ci-fast.sh --filter mb_strlen_enumgreenruntime/*.cRelated