Le 24/03/2022 à 16:06, Mark Niebergall a écrit :
So you are correct, the const value does have a value that has a type, but there is no way to enforce which type the value is or to use const with inheritance, which is part of the bigger picture here.
That was exactly my point: the type could simply implicitely be the one of the original value.
Then the engine just has to use the existing covariance/contravariance rules for type checks based upon the guessed value type. This would fix the type safety issue you are referring to.
-- Regards -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php