-
-
Notifications
You must be signed in to change notification settings - Fork 929
Closed
Description
Bug report
In version 1.10.15, PHPStan's handling of strval() changed (see phpstan/phpstan-src#2354)
Since then, the following does not work any longer on level 9:
$value = strval(constant('SECRET'));
Parameter #1 $value of function strval expects bool|float|int|resource|string|null, mixed given.
The following was never allowed:
$value = (string) constant('SECRET');
Cannot cast mixed to string.
This is now the only solution/fix, is this intended behavior?
/** @var string $value */
$value = constant('SECRET');
Metadata
Metadata
Assignees
Labels
No labels