RE: [PHP-DEV] Scalar type hinting

From: Date: Tue, 28 Feb 2012 19:53:29 +0000
Subject: RE: [PHP-DEV] Scalar type hinting
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
OK everyone, it seems that some people have forgotten or missed the original agreement that this
thread started with. There is a communication disconnect ("strict typing" means horribly
different things to different people right now). Please read through and understand the following
terminology before continuing to post on this thread. We've agreed to the following terms:

- "Strict Typing" means the super strict old C style typing *with no implicit
conversions*. (If you really think this is what you want, you are probably mistaken. Look through
prior discussions on this topic. This fails for numerous reasons, including the fact that almost
every input to PHP is a string.)
- "Weak Typing" means types in the same sense that the PHP documentation uses types (for
example, the docs indicate substr(string, integer), and substr(12345, "2") ==
"345".) (If you think you want "strict typing", this is probably what you mean.)
- "No Scalar Typing" should be used to indicate the current system (where there is no
provision for hinting at scalar types.)

In addition, if someone potentially new expresses support for "Strict Typing", please
assume that they really mean weak typing unless proven otherwise (this is by far the more likely
intent.) Don't get mean, politely clarify terminology so that everyone can be on the same page.
If someone still insists that they want "Strict Typing" (as defined above), point them to
the prior discussions on the topic which explain exactly what the problems with this are.

John Crenshaw
Priacta, Inc.


Thread (163 messages)

« previous php.internals (#58267) next »