Re: [RFC] Scalar Type Hints v0.2
| From: | Jordi Boggiano | Date: | Thu, 15 Jan 2015 15:39:39 +0000 |
| Subject: | Re: [RFC] Scalar Type Hints v0.2 | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-80560@lists.php.net to get a copy of this message | ||
On 15/01/2015 15:30, Benjamin Eberlei wrote:
The potential issues with this are pretty real, to be honest. Simple
things like moving a method from one class to another (let's say to
parent or descendant) and getting to another typing context may cause
unpredictable behavior if the user forgets to have declare() in both
files.
This alone is a very big argument against it imho. Next argument
would be using different libraries in one file and wanting one of them
to be strict the other not.
If you want both you can just use the non-strict default and do type checks yourself where you see fit.
If you had strict typing only or weak only you anyway could not choose which library should be strict, each library would decide for you.
Cheers
--
Jordi Boggiano
@seldaek - http://nelm.io/jordi