Re: Re: Flexible type hinting
| From: | Ólafur Waage | Date: | Thu, 02 Jul 2009 21:19:33 +0000 |
| Subject: | Re: Re: Flexible type hinting | ||
| References: | 1 2 3 4 5 6 7 8 9 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-44673@lists.php.net to get a copy of this message | ||
On Thu, Jul 2, 2009 at 9:09 PM, Ryan Panning <rpanning@gmail.com> wrote:
> 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! ;).
>>
>
> Just want to throw my 2 cents in.
>
> Big +1 for this syntax
>
> I think with the addition of this and __cast() for objects, PHP's OO will
> be very flexible and can build great Frameworks, ORM's, etc.
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
function($quantity)
function(int $quantity) STRICT type
function(?int $quantity)
Thought id throw it out there. Interesting discussion though.
Ólafur