Re: Re: Flexible type hinting

From: Date: Fri, 03 Jul 2009 14:15:33 +0000
Subject: Re: Re: Flexible type hinting
References: 1 2 3 4 5 6 7 8  Groups: php.internals 
Request: Send a blank email to internals+get-44684@lists.php.net to get a copy of this message
Ford, Mike wrote:
    function func(int $i)
for strict type checking, and
    function func((int)$i)
for coercion aka casting (although now I've seen it written down I'm not so sure! ;).
I had thought about having "weak" and "strong' type checking even before Paul sent his proposal, but I rejected the idea myself for the confusion it might cause because I couln't think of a good syntax. This one actually looks pretty good, it's intuitive and consistent with what the language offers now. Big +1 regards Rodrigo Saboya

« previous php.internals (#44684) next »