Re: Re: [RFC] [PRE-VOTE] Union types
| From: | Bob Weinand | Date: | Thu, 02 Jun 2016 19:49:40 +0000 |
| Subject: | Re: Re: [RFC] [PRE-VOTE] Union types | ||
| References: | 1 2 3 4 5 6 7 8 9 10 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-93731@lists.php.net to get a copy of this message | ||
> Am 02.06.2016 um 21:43 schrieb Fleshgrinder <php@fleshgrinder.com>:
>
> On 6/2/2016 9:40 PM, Bob Weinand wrote:
>> is_numeric() is returning a boolean (that's the condition). $str+0 does conditionally
>> cast to int or float (whatever the string specifies).
>>
>
> php -r 'var_dump("foo" + 0);'
> int(0)
>
> This is what I am referring too. Shouldn't this crap result in an error?
>
> is_numeric($x) || throw TypeError('no no');
>
> --
> Richard "Fleshgrinder" Fussenegger
>
Oh, well… Better now?
Bob