Re: [RFC] Scalar Type Hinting With Casts (re-opening)
From: Alain Williams Date: Wed, 16 Jul 2014 09:16:59 +0000 Subject: Re: [RFC] Scalar Type Hinting With Casts (re-opening) References: 1 2 3 4 5 6 7 8 9 10 Groups: php.internals Request: Send a blank email to internals+get-75579@lists.php.net to get a copy of this message
On Wed, Jul 16, 2014 at 09:31:46AM +0100, Rowan Collins wrote: > Now, one form of compromise is to use variants of the syntax, such as... > > function foo((int) $bar) > function foo(-int $bar) > ... A slight tangent, but *if* this sort of syntax is adopted we need to think what will happen when someone puts a class name in there instead of a basic type. I would suggest that it be a compile error of some sort if the 'type' is anything other than int, float, .... The only one that may make sense is function foo((array) $bar) If $bar is not an array it would make an array containing one element with value $bar. -- Alain Williams Linux/GNU Consultant - Mail systems, Web sites, Networking, Programmer, IT Lecturer. +44 (0) 787 668 0256 http://www.phcomp.co.uk/ Parliament Hill Computers Ltd. Registration Information: http://www.phcomp.co.uk/contact.php #include <std_disclaimer.h>
Thread (250 messages)
- RE: [PHP-DEV] [RFC] Scalar Type Hinting With Casts (re-opening)
- Re: [RFC] Scalar Type Hinting With Casts (re-opening)
- RE: [PHP-DEV] [RFC] Scalar Type Hinting With Casts (re-opening)
- RE: [PHP-DEV] [RFC] Scalar Type Hinting With Casts (re-opening)
- RE: [PHP-DEV] [RFC] Scalar Type Hinting With Casts (re-opening)
- RE: [PHP-DEV] [RFC] Scalar Type Hinting With Casts (re-opening)
- RE: [PHP-DEV] [RFC] Scalar Type Hinting With Casts (re-opening)
- RE: [PHP-DEV] [RFC] Scalar Type Hinting With Casts (re-opening)
- Re: [RFC] Scalar Type Hinting With Casts (re-opening)
- RE: [PHP-DEV] [RFC] Scalar Type Hinting With Casts (re-opening)
- Re: [RFC] Scalar Type Hinting With Casts (re-opening)
- Re: [RFC] Scalar Type Hinting With Casts (re-opening)
- Re: [RFC] Scalar Type Hinting With Casts (re-opening)
- Re: [RFC] Scalar Type Hinting With Casts (re-opening)
- Re: [RFC] Scalar Type Hinting With Casts (re-opening)
| « previous | php.internals (#75579) | next » |
|---|