On Fri, Apr 18, 2008 at 9:03 AM, Lukas Kahwe Smith <[EMAIL PROTECTED]> wrote: > Suddenly I need to ensure that all my variables have the proper types. So > what will people do? > .... > So maybe an "(int)" here or there > is not so much more code to type, but you can already see that code you safe > on one end, you have to start adding on the other, the one which you write > more often.
You are right, of course. I stated before that the hints automatically casting the parameter is the best approach. With automatic casting, which seems to be fairly obvious semantics for type hints, you will not need to cast at call-time. > More importantly, in some cases simple type juggeling with > "(int)" will not be sufficient, you might have to do some minor checks etc. > In the past library authors did this as part of the code that the strict > type hinting camp is now hoping to remove. So again more code in my glue > code. There isn't a strict typing camp. Felipe's first patch was just checking, which didn't provide any guarantees to the library author. The second was strict typing, which provides guarantees, as you say, at great expense. I am hoping that the third will be casting, which provides guarantees, at no call-time expense. Paul -- Paul Biggar [EMAIL PROTECTED] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php