On 4/21/16 2:11 PM, Fleshgrinder wrote:
What I love about PHP is that we have a lot under one hood: multi-paradigm as well as loose and strict types. This allows one to choose the best tool for the current job.
^^ That thing. PHP is a very eclectic language. That's a good thing. Does that mean there's a lot to know? To an extent, yes. But frankly, I still find needle/haystack more confusing than any of the new features from the "PHP 6" era (PHP 5.3-5.6) or PHP 7. And things that Zeev is (rightly) encouraging like async primitives would likely be far more confusing for current PHP developers than being able to say "this parameter has to implement both of these interfaces".
No one is arguing that typing is a replacement for testing. However, typing is a form of logical proof. Logical proof is a way of demonstrating the absence of bugs, albeit an incomplete one. Testing is a way of demonstrating the absence of bugs, albeit an incomplete one. Testing establishes an upper bound on bugs, while proof/typing establishes a lower-bound. Having robust options for both available lets developers pick one, the other, or both as appropriate for their project.
Does that mean "PHP is broken?" No, that's an absurd strawman. Does being against union types or scalar types or property types mean "PHP is perfect?" No, that's also an absurd strawman.
But there are unquestionably cases where robust typing is helpful. We should allow that, and encourage the development of more robust typing for those cases where it is helpful. But completely untyped PHP is still 100% legal today and no one on this list is suggesting removing it.
Typing in PHP doesn't have to be a strict either/or. That's what's so great about PHP's emerging type system: Typed and untyped code can coexist reasonably peacefully.
Can typed and untyped supporters do the same? I hope so... -- --Larry Garfield -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php