2012/10/16 Stas Malyshev <smalys...@sugarcrm.com> > Also, the fact is that other dynamic languages do not > have strong typing. It may be they just aren't smart enough to recognize > everybody needs it - or there may be a reason why it doesn't happen. I > think there is a reason > > > Doing the same for object properties (always optional) could be very > useful. > > Not really, since PHP is not a compiled language and as such does not > have static type controls. Now not only every foo($bar) can blow up but > also every $foo->bar = $baz. Not very useful. >
If the first could be useful, the second could be useful too. Or you are saying that parameters type hinting was a bad idea? You can argue using other languages' design choices, but it shouldn't drive our own choices. Every methods and properties are public in Python; it doesn't mean PHP is doing wrong (nor Python is doing wrong). Last thing: I agree with Clint and you. If it was early checked, it would be better. But the current type hinting is far better than nothing at all. Yes, we can't "lint" it, but it was pretty useful a big number of times in my company. was outlined some 9000 times here on the list. > OK, sorry for the trouble.