### Bug report PHPStan incorrectly reports a type error when using ltrim() with the result of number_format() inside strlen() ```php function ok(): int { return strlen(number_format(15, 0, '', '')); } /** * @param numeric-string $str */ function ok2(string $str): int { return strlen($str); } function fail(): int { return strlen(ltrim(number_format(15, 0, '', ''), '-')); } ``` **Error:** Parameter #1 $string of function strlen expects string, numeric-string given. ### Code snippet that reproduces the problem https://phpstan.org/r/73c4b606-2bc7-4450-8c0d-3bdc7867dd75 ### Expected output No error ### Did PHPStan help you today? Did it make you happy in any way? _No response_
Activity
VincentLanglet commentedon Nov 11, 2025
Should be solved with phpstan/phpstan-src#4550
github-actions commentedon Jan 6, 2026
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.