Yasuo Ohgaki wrote: > On Thu, Apr 30, 2015 at 8:24 AM, Stanislav Malyshev <smalys...@gmail.com> > wrote: > >> PHP types are not machine native types. But yes, it forces PHP type - >> that's why it is *type* check. > > Type hint is better to stay as "hint" under weak mode. IMO.
"Type hints" have never been hints. The wording is a misnomer. Try to pass an int to a parameter declared as array, for instance. >> You are saying type checking which produces fatal errors does not match >> your use case. OK, I can sympathize, but how introducing more >> pseudo-types helps? You just fix one narrow use case that you have right >> now while leaving the problem still in the same place. That's not a good >> way to address it. > > I'm not concerning myself, but I'm worrying about users to write > apps/libraries > that can cause DoS easily. I don't want to see my my apps emit fatal error > by upgrading library just because library author decided to use type hint > wrongly. A fatal error wouldn't constitute a DoS vulnerability, would it? > BTW, GMP integer is already integrated into PHP why not treat GMP as int? > It's type "hint", isn't it? The basic idea of the STHs is to guarantee that the value is of the respective type inside the function (parameter type "hints") resp. the return value (return value type "hints") has the respective type. Accepting GMP for int just won't fit to this definition -- or it would lead to a potentially considerable data loss. -- Christoph M. Becker -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php