Re: [RFC] Scalar Type Hints v0.2
| From: | Andrea Faulds | Date: | Mon, 02 Feb 2015 08:32:05 +0000 |
| Subject: | Re: [RFC] Scalar Type Hints v0.2 | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-81561@lists.php.net to get a copy of this message | ||
Hi Dmitry,
--
Andrea Faulds
http://ajf.me/
> On 2 Feb 2015, at 07:02, Dmitry Stogov <dmitry@zend.com> wrote:
>
> As I already told, in my opinion, version 0.1 was the perfect solution that fit into PHP
> semantic very well.
>
> declare(strict_types=1); - is really weird solution.
> It changes type hinting behavior per file scope, so, just to try strict type hinting in a big
> project, people will have to change every single PHP file.
> From the RFC text, I didn't completely understand, if declare() affects call site or
> declaration. Will we able to call the same function using weak type hinting from on file and with
> strict from the other?
> "The strict type checking mode also affects extension and built-in PHP functions",
> sin(1) - error !!!
>
> Strict type hinting is not suitable for PHP by definition (as a weakly typed language),
> however, I see, it may be useful in some cases.
> I would prefer to have "weak" types at first, then think about introducing ability to
> switch to "strict" type hinting in context of use-cases.
>
> Thanks. Dmitry.
>
>
>
>
>> On Mon, Feb 2, 2015 at 2:49 AM, Andrea Faulds <ajf@ajf.me> wrote:
>> Good evening,
>>
>> The RFC has been updated to cover return types, since Levi’s Return Types RFC has passed.
>> The patch is a work in progress: it works, but lacks tests for return types.
>>
>> Version 0.3 of the RFC can be found here:
>> https://wiki.php.net/rfc/scalar_type_hints
>>
>> Thanks!
>> --
>> Andrea Faulds
>> http://ajf.me/
>>
>>
>>
>>
>>
>> --
>> PHP Internals - PHP Runtime Development Mailing List
>> To unsubscribe, visit: http://www.php.net/unsub.php
>