On Thu, Feb 26, 2015 at 9:28 AM, Theodore Brown <theodor...@outlook.com> wrote: > I am a full-time PHP developer responsible for maintaining several large > enterprise applications, as well as a number of libraries and personal apps. > I have been following the scalar type proposals quite closely, as along with > return type declarations, scalar types have the potential to reduce errors, > simplify API documentation, and improve static code analysis. > > I am in favor of Anthony's Scalar Type Declarations RFC, for two simple > reasons: > > 1. It doesn't change the behavior of existing weak types. > 2. Strict types are important in some cases. >
After carefully reviewing both proposals and testing the implementations out, and switching opinions many times, I've come to the same conclusion as this. (I'm glad the define() syntax was simplified.) With more and more discussion, I feel like the coercive version is just degrading back into the same weak casts as we already have. If I can pass null or " 1 " or bool to an int, then it becomes less like a different RFC and more like the same strict types RFC but without the strict mode! To be clear, I'd actually be fine with a weak-only implementation that follows the same exact rules as the explicit casts. And I'm okay with strict-mode optionally tacked on top of that -- because it can be useful and won't get in my way. But I'm no longer in favor of any in-between coercive implementation. Not a voter, so just my 2 cents. -- Matthew Leverton -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php