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
Math builtins reject numeric strings where Zend coerces via _convert_to_double(). Example: floor("3.7") returns 3.0 in Zend but throws LogicException here.
Category
stdlibProblem
Math builtins reject numeric strings where Zend coerces via
_convert_to_double(). Example:floor("3.7")returns3.0in Zend but throwsLogicExceptionhere.php-src reference
ext/standard/math.c—PHP_FUNCTION(floor),PHP_FUNCTION(ceil),PHP_FUNCTION(round),PHP_FUNCTION(fmod)Zend/zend_operators.c—_convert_to_double()/ numeric-string rulesRepro
floor("3.7")3.0LogicException: floor() only supports integers and floatsceil("3.1")4.0round("3.5")4.0fmod("5","2")1.0Scope
ext/standard/floor.php,ceil.php,round.php,fmod.php— use shared numeric coercion helper (seeVmReflection::numericArg()/_convert_to_doubleparity used elsewhere)JitLongArg/ float lowering after coerciontest/compliance/cases/stdlib/math_numeric_string.phptDone when
bin/vm.phpTypeErrorlike Zend (not silent0)./script/ci-fast.sh --filter math_numeric_stringgreen