In mathematic, equal meen the same value AND the same nature.
The follow fact could be frustrating :

Code :
<? php echo 'you must understand than 1 + 1 = 2' ?>
Output :
you must understand than 2 = 2


----- Original Message ----- From: "Stanislav Malyshev" <[EMAIL PROTECTED]>
To: "Chris Stockton" <[EMAIL PROTECTED]>
Cc: <internals@lists.php.net>
Sent: Monday, June 16, 2008 11:02 PM
Subject: Re: [PHP-DEV] [RFC] Strict type hints (parameter and return value)


Hi!

Maybe we should stop using the 1 and '1' argument, yes, they can be

Maybe not, while there are people that fail to understand it. Here:

But try to remember, 1 !== '1' and PHP is not an end all language, often
we have to communicate to strictly type systems, we need to be positive

So you just ignored the "special cases" part. Yes, if you have special
case where you interface with very brain-dead strictly typed system that
absolutely can't understand that '1' and 1 is the same - then you need
to _convert_. So how failing when you get '1' instead of 1 helps you?
You'd need _conversion_, not _failure_ - and if you write strictly-typed
API, you'd move the conversion responsibility to the user, instead of
having it where it belongs - in the API. That's *exactly* why I see
strict typing in PHP so dangerous - it promotes lazyness and sloppiness
in API writing, and those APIs will be a nightmare to use, since they
would bomb out on slightest disagreement about internal engine types,
which the API user shouldn't care about at all. What happened with "be
liberal at what you accept"?
In strict compiled languages, the compiler and IDE will guide you
through this, in PHP you'd just have it explode in your face in
production. How this is good for anybody?
--
Stanislav Malyshev, Zend Software Architect
[EMAIL PROTECTED]   http://www.zend.com/
(408)253-8829   MSN: [EMAIL PROTECTED]


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






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

Reply via email to