It would make sense that the default value you're setting matches the
zval.type of the casted value.

You always want it to be an int, if you're doing (int) so setting it
to a string or array would not make sense.

- Paul.

On Sun, Mar 4, 2012 at 4:46 PM, Lazare Inepologlou <linep...@gmail.com> wrote:
> Anthony, just a tiny detail in your RCF:
>
> So (int) $foo = null and (int) $foo = 1 are both supported, but (int) $foo
>> = “1” will generate an E_COMPILE_ERROR.
>>
>
> If null is going to be cast, (int)null is 0. So I don't think it should be
> a valid default value.
>
>
> Lazare INEPOLOGLOU
> Ingénieur Logiciel
>
>
> 2012/3/4 Anthony Ferrara <ircmax...@gmail.com>
>
>> Hey all,
>>
>> I've drafted an RFC for the Parameter type casting hint proposal that
>> I posted to before.  Attached to the RFC is a patch that's proposed
>> for inclusion in core for functionality (it doesn't include news
>> entries, or documentation, or any of the other steps that would be
>> needed prior to commit).
>>
>> https://wiki.php.net/rfc/parameter_type_casting_hints
>>
>> Please provide feedback here on the implementation and RFC topics.
>>
>> Thanks,
>>
>> Anthony
>>
>> --
>> 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