Re: [RFC] Scalar Type Hinting With Casts (re-opening)
From: Alexey Zakhlestin Date: Mon, 14 Jul 2014 15:02:13 +0000 Subject: Re: [RFC] Scalar Type Hinting With Casts (re-opening) References: 1 2 3 4 5 Groups: php.internals Request: Send a blank email to internals+get-75469@lists.php.net to get a copy of this message
On 14 Jul 2014, at 18:57, Andrea Faulds <ajf@ajf.me> wrote: > On 14 Jul 2014, at 15:54, Derick Rethans <derick@php.net> wrote: > >> A compromise by adding more inconsistencies. >> >> I can buy the cast of scalars vs hint--of-complex types, but definitely >> not the introduction of a new group of casting rules. Keep it simple. > > It doesn’t change the casting rules; write an error handler that ignores E_RECOVERABLE_ERROR > and you get exactly the same result as a manual cast inside the function. Rather, it simply adds > validation. The casting works like casting does everywhere else, but there’s strict lossless > validation on the type hint, similar to the non-scalar type hints except more lenient as it allows > equivalent values of other types. ok, it might work for me if formulated like this. now, the question is, would it be possible to port these rules to zpp in PHP-Next? if the answer is “yes", then I’m all for it. otherwise, I’m a bit skeptical as inconsistency between extension-land and user-land code worries me -- Alexey Zakhlestin CTO at Grids.by/you https://github.com/indeyets PGP key: http://indeyets.ru/alexey.zakhlestin.pgp.asc
Attachment: [application/pgp-signature] Message signed with OpenPGP using GPGMail signature.asc
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 (#75469) | next » |
|---|