Live data from Hacker News

PHP 7.2.0 Released

php.net

11–20 of 80 posts

Re: PHP 7.2.0 Released

#11
Seems like a solid gradually improving release and according to some benchmarks [1] and notes from the development team, improved performance as well. Nothing like the jump the ecosystem enjoyed from 5.6 to 7.0, but still around 10% on average.

[1] https://symfony.fi/entry/php-7-1-vs-7-2-benchmarks-with-dock...

Re: PHP 7.2.0 Released

#12
post #10

What is PHP like nowadays? I know it has a bad reputation and a history of kitchen sink design but have they managed to tame it into something more sensible? Do the docs help steer developers away from legacy issues and common bad patterns? Would anyone recommend it for new projects?

> What is PHP like nowadays? Would anyone recommend it for new projects?

It is not bad at all but since there are so many good/better alternatives I would never start a fresh project with PHP nowadays.

The only reason would be if you have a team with PHP experts - then PHP would be the obvious choice.

Re: PHP 7.2.0 Released

#14
post #10

What is PHP like nowadays? I know it has a bad reputation and a history of kitchen sink design but have they managed to tame it into something more sensible? Do the docs help steer developers away from legacy issues and common bad patterns? Would anyone recommend it for new projects?

> What is PHP like nowadays? Would anyone recommend it for new projects? It is not bad at all but since there are so many good/better alternatives I would never start a fresh project with PHP nowadays. The only reason would be if you have a team with PHP experts - then PHP would be the obvious choice.

Unsexy yes, but stable and works a charm for most of the scale people here will deal with.

What alternative would you suggest for newer projects?

Re: PHP 7.2.0 Released

#15
post #10

What is PHP like nowadays? I know it has a bad reputation and a history of kitchen sink design but have they managed to tame it into something more sensible? Do the docs help steer developers away from legacy issues and common bad patterns? Would anyone recommend it for new projects?

For new projects only if you have an established php team / related projects.

Modern OOP development in PHP 7 feels basically like an older version of Java (pre Generics), solid for engineering, but ugly for anyone who expects newer language features.

Re: PHP 7.2.0 Released

#16
post #10

What is PHP like nowadays? I know it has a bad reputation and a history of kitchen sink design but have they managed to tame it into something more sensible? Do the docs help steer developers away from legacy issues and common bad patterns? Would anyone recommend it for new projects?

Four words : composer, symfony, laravel and php-fig.

The php ecosystem is not what it was 4 years ago. Although due to backward compatibility the languages still has a lot of cruft. But this means old code often works directly with the last version and benefits from its performance improvement.

If your new project is about receiving an http request and send a response like a REST API I think it is a good tool for the job. If you want long lived process (kafka/rabbitmq consumers for example) or sockets it is possible to do it in php but you'll have a better experience with other stacks.

Re: PHP 7.2.0 Released

#17

Earlier quoted context omitted.

> What is PHP like nowadays? Would anyone recommend it for new projects? It is not bad at all but since there are so many good/better alternatives I would never start a fresh project with PHP nowadays. The only reason would be if you have a team with PHP experts - then PHP would be the obvious choice.

Unsexy yes, but stable and works a charm for most of the scale people here will deal with. What alternative would you suggest for newer projects?

If you’re looking towards hosting on shared style infra, php is still the choice. Also if you just have experienced PHP devs

Python is a pretty great alternative - it gives you more breadth to go wide than PHP does (batch processing, hadoop, machine learning, whatever really) but really there are like 10-20 different languages in the ecosystem that are all viable candidates.

Re: PHP 7.2.0 Released

#18
post #16
post #10

What is PHP like nowadays? I know it has a bad reputation and a history of kitchen sink design but have they managed to tame it into something more sensible? Do the docs help steer developers away from legacy issues and common bad patterns? Would anyone recommend it for new projects?

Four words : composer, symfony, laravel and php-fig. The php ecosystem is not what it was 4 years ago. Although due to backward compatibility the languages still has a lot of cruft. But this means old code often works directly with the last version and benefits from its performance improvement. If your new project is about receiving an http request and send a response like a REST API I think it is a good tool for the…

The kind of worn out ecosystem is my main dig with PHP. A couple parts of the ecosystem are outstanding, especially laravel, though laravel’s DId internals are a maze. (side note: Not a fan of DI being more or less required - it’s necessary for testing but the pattern is just a mess. Lack of static typing makes PHP kind of mediocre at DI, too)

Outside of that there’s a ton of abandonware or just generally unmaintained libraries, though, and daemon/batch style processing is a tremendously common requirement that’s better served by other stacks.

Re: PHP 7.2.0 Released

#19
post #10

What is PHP like nowadays? I know it has a bad reputation and a history of kitchen sink design but have they managed to tame it into something more sensible? Do the docs help steer developers away from legacy issues and common bad patterns? Would anyone recommend it for new projects?

The modern ecosystem (Symfony 3/4 especially) and practices enabled by 7.0+ are good, but all the old horror is still lurking behind the curtain, and there's not much to prevent naive coders from writing garbage like it's 1999. It's not that dissimilar from the Javascript situation, where you have some people still writing spaghetti jquery in random globally-namespaced places and some people in basically a whole other world writing type-checked and compiled modular code.

Some important things like sensible fast native data types (php-ds) are still in extensions instead of core because they're recent developments, and there are still a lot of traps and dead-ends from past failures in the standard library, but it's improving with each release. The addition of sodium to core in 7.2 is a really important step forward.

Re: PHP 7.2.0 Released

#20
post #2

Literally only object as new typehint, not the classname of the object? This doesn't really help much. https://wiki.php.net/rfc/object-typehint Looks like they went back into perl-mode

Class based type hinting has already been available since 2004 with 5.0 [1] This release adds support for the general standard object type.

[1] http://php.net/manual/en/functions.arguments.php#functions.a...

Post reply on HN