Hacker News new | past | comments | ask | show | jobs | submit login

For years it was a very permissive language that allowed you to do a lot very quickly but then with a lot of overhead to make sure things were correct.

E.g., I've seen a payment management suite that was written using php traits, which then had a super class that everything descended from, meaning every service could do everything, completely breaking OOP. For example, a DirectDebitService has methods like processMandate(), processDd(), but then because of the traits it also has access to processCreditCardPayment(). As you can imagine this made unit testing literally anything require lines of set up code and just made things impossible to work with.

With the introduction of classes, and PHP 7's scalar type declarations as actual keywords rather than just PHP docs, as well as the option for strict comparison, plus the ridiculous speed improvement between 5.6 and 7.0.

Further, tools like composer (which I think was actually one of the first modern package managers (with lock files, version selectors), Behat for integration tests, plus the huge steps frameworks have made in removing in overhead have made PHP actually a very nice language to write these days.

Deployment in a micro service context is still annoying as PHP's built in web server is not great, requiring you to have an Ngninx pointing at a PHP-FPM which actually serves each of your microservices.

You may think you can get away with one Ngninx, but then as soon as micro services start requiring things like scaling it's a pain in the arse. E.g. you may wish to do rate limiting or rbac or something for a specific service, requiring an nginx->PHP-FPM in front of each PHP service.

I'm sure there are cleverer ways to get around this but this is the way I always go and the way I've seen other PHP deva go




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

Search: