Re: [RFC] Scalar Type Hints v0.2
| From: | Thomas Bley | Date: | Thu, 15 Jan 2015 21:29:52 +0000 |
| Subject: | Re: [RFC] Scalar Type Hints v0.2 | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-80595@lists.php.net to get a copy of this message | ||
I don't think any junior-middle php developer with understand how "(int)" works.
Just make a test and see how many will answer (int)'asd' with 1.
Regards
Thomas
S.A.N wrote on 15.01.2015 22:18:
> The main advantage of the two syntaxes:
>
> 1. Strict
> function bar(int $num){}
>
> 2. Weak
> function bar((int) $num){}
>
> Any junior-middle PHP developer, seeing this syntax in the code can understand how it works,
> without studying the documentation and without your complex conversion tables.
>
> Explicit is better than implicit, is the motto Python, here it is very relevant.
>