Re: Type hinting
| From: | Etienne Kneuss | Date: | Fri, 28 May 2010 09:22:34 +0000 |
| Subject: | Re: Type hinting | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-48545@lists.php.net to get a copy of this message | ||
Hi,
Apparently, the discussion is not looking like it will end up in a
general agreement. I'd suggest the following:
1) Since it seems that there is concerns about the current
auto-casting RFC (inconsistencies, when/what errors, etc..), I believe
it's authors should refine the RFC to propose what they want in a more
precise way, unless what is available is exactly what they want, in
which case they should state it. In my opinion, it should include:
- The complete set of rules to apply
- In case it is not like it is done internally, whether we should make
it consistent (e.g. change the way arguments are passed to internal
functions)
- In which case an error is triggered, and what errors/exception
- If the current hints of arrays/objects should be relaxed somehow
(i.e. ArrayObject instance accepted for an "array" argument)
2) For strict typing, I believe it is clear about what it does.
However, there is still room for discussion on:
- Whether all types "hints" should be available (or, e.g. only numeric/scalar)
- What errors/exception to trigger
so, it would be nice to update the RFC(s), so that we have a solid
ground on which we can discuss/vote.
Best,
On Fri, May 28, 2010 at 02:57, Philip Olson <philip@roshambo.org> wrote:
>
> This thread needed post #100 so here goes:
>
> - We want both options, can we accept this and focus on making it happen?
> - I love using === but am okay with others ab^H^Husing ==
> - The strict type hinting patch now includes 'numeric' and 'scalar' type
> hints
>
> Regards,
> Philip
>
>
--
Etienne Kneuss
http://www.colder.ch