Re: [VOTE][RFC] Scalar Type Hinting with Cast

From: Date: Sun, 14 Sep 2014 00:10:20 +0000
Subject: Re: [VOTE][RFC] Scalar Type Hinting with Cast
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-77170@lists.php.net to get a copy of this message
On 14 Sep 2014, at 01:07, Alain Williams <addw@phcomp.co.uk> wrote: > You give an option for float to int casting to truncate. Where? oa-res-27-90:php-src ajf$ sapi/cli/php -r 'function foobar(int $a) { var_dump($a); } foobar(1.5);' Catchable fatal error: Argument 1 passed to foobar() must be of the type int, float given, called in Command line code on line 1 and defined in Command line code on line 1 If you mean under possible changes, it’s not a change that’s been made. It’d only be worth discussing within the context of making it truncate or round. -- Andrea Faulds http://ajf.me/

« previous php.internals (#77170) next »