Björn Larsson wrote on 22/03/2016 15:04:
Hm... In Hack the above code works, see:
https://3v4l.org/nsA5W

Well they have a different implementation as mentioned in
the RFC, so no wonder. But they do have typed porperties in
the language.

It's not just a different implementation, it's a completely different feature - there's no actual type checking at runtime, the type hint is more like an annotation for use with static analysis tools. See https://3v4l.org/ntCr7 which happily assigns int(6) to the "typed property" in HHVM, but is detected by the RFC branch.

(Incidentally, I note the TypeError's message is missing the variable name; I presume that's either a known issue or an out-of-date build on 3v4l?)

Regards,
--
Rowan Collins
[IMSoP]

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to