Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Speaking as someone who works on a 2 million user enterprise app with standard PHP, i would have to counter that: 1) the footguns are easy to sidestep once you know them and are gradually getting removed, 2) standard php has traits and strict typing, but the typing is not for primitive types (which is what Hack adds) and 3) in nearly a decade i have had a single feature where i could have really used a faster php, whereas in practice my performance issues all come from the Oracle bottleneck because php is so easy to parallellize. Facebook could run on standard php, it would just require more hardware, and since releasing hhvm php has gotten a lot faster without breaking backwards compatibility.


I'm curious on how many servers does it run :)


PHP(.net) doesnt have strict typing ,but type hinting, which is not the same.


It does have strict typing with objects, but not literals.

If I make a function meow(MyClass $meow) { } it will throw errors if anything other than a MyClass is given to it, including NULL.


You are wrong , it has type hinting , not strict type checking. You can alias types, there is no hard types in PHP except for arrays. Your function signature check the name of the object in the namespace , not it's type.


function meow(MyClass $meow) { }

This will only accept an object that is_a MyClass. It can either implement an interface MyClass, extend an abstract MyClass, extend a regular class MyClass, or be the actual object MyClass.

Namespaces have nothing to do with this, other than you being able to use the "use" statement at the top to alias it.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: