Look it boils down to the following: True type enforcement ala === (i.e. you pass "1" to an int and it errors out) does not make sense for PHP (and yes, philosophy and design goals of the language are important). Forget even the argument that this is not how PHP works all around and is inconsistent with what we've done from day 1 but more importantly if you are going towards strict typing then you need a type system to implement that during "compile-time" (i.e. like C or Java). You otherwise loose out because you are pushing out all these type problems into production and it'll lead to too many production errors, often when it may not have to be an error.
What I suggested in my previous email is type hinting which also does the conversion to the request type. This is very much in the PHP spirit and also how PHP's internal functions work today. It is "consistent". Copy&pasting from my previous email the following would work: function iwantint(int $n) { iwantint("1"); // "1" + 1 works great. function iwantstring(string $str) {} iwantstring($toStringObject); // Works in strcmp() function iwantfloat(float $f) {} iwantfloat(2); function iwantbool(bool $b) {} iwantbool(1); But honestly adding strict type hinting ala (int === int) just does not make sense in this language. There's a reason why C/Java are able to enforce this at compile-time and don't push this equality into runtime. It's not we are right or wrong vs. those languages it's that those languages take it all the way and when requiring true strict typing they do it right. In PHP this equates to extending PHP with C. Andi > -----Original Message----- > From: Sam Barrow [mailto:[EMAIL PROTECTED] > Sent: Friday, January 04, 2008 10:49 AM > To: Andi Gutmans > Cc: Ilia Alshanetsky; Stas Malyshev; internals Mailing List > Subject: RE: [PHP-DEV] type hinting > > On Fri, 2008-01-04 at 10:37 -0800, Andi Gutmans wrote: > > I think the "mixed" identifier is a minor issue but I also don't see > > it's purpose. If you don't want type hinting then don't write a type > > hint. It's also tool friendly... > > Andi > > It is kind of pointless, just syntactic sugar to be honest. Not a big > deal at all though. I'd like it as I said for the syntactic sugar but > personally I don't care too much. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php