Live data from Hacker News

PHP 8.1.0

php.net

101–110 of 286 posts

Re: PHP 8.1.0

#101
post #57

Fibers!!! Who wants to bet we are a few releases away from async/await syntax now. Giving credit where it’s due Microsoft with C# pioneered the syntax and every classic (including a few modern) language has adopted the syntax. I believe we are a few steps away from a fully builtin production ready server and db connection support.

I think the hope here is that you don't need async/await syntax. The fiber implementation is supposed to abstract over both sync and async implementations.

Re: PHP 8.1.0

#102
post #73

Earlier quoted context omitted.

PHP bigwigs just announced the PHP Foundation to secure PHP’s future. Announcement https://blog.jetbrains.com/phpstorm/2021/11/the-php-foundati... PHP Foundation https://opencollective.com/phpfoundation Accepts donations to help the development of PHP.

I don't think that's a good sign. The community's complaints with PHP are far more concerned with technical matters relating to the language, runtime and libraries than how Zend etc have handled the usual issues in politics and project governorship. I don't think PHP has ever had a brouhaha anything like what happens in Java's JCP or the Oracle sale. Other platforms (like .NET) have their own foundations but they are…

If you read the announcements it explains why they are doing it.

PHP is a community driven project, comparing that with C# or Java is a bit unfair because they are backed by companies worth billions.

What you describe about Zend I think that is more the old days before PHP 7. I don’t have the full picture of this but my understanding is that because of the failure of PHP 6 (never released), another group of developers from the community started to work with PHP 7 and I don’t think neither of them was from Zend.

Today there is an open RFC process and anyone can submit an RFC and then the core teams votes on it. If you contribute to PHP you can become a member of the core team.

https://wiki.php.net/rfc

If you want to be part of the discussion you can join the internals mailing list. Here you can read it without joining.

https://externals.io/

If someone is unhappy with direction of PHP my advice to them is to start contributing, bug fix, write documentation, translate, write RFCs, implement functionality, code review etc. Why? because PHP today is a community driven project.

Re: PHP 8.1.0

#103
post #77

Genuinely curious: who here thinks PHP is a good choice for a new project and also has experience with other languages such as Scala, Kotlin, Python, or JavaScript and their respective web frameworks?

If it is what you/your team are most confident in and it is suitable to solve the problem (i.e a typical MVC web application), then yes, it is a very sensible choice. If your confidence lies elsewhere, then no, choose that instead. End of the day you’re just solving a problem using code.

Re: PHP 8.1.0

#104
post #50

Say what you want about PHP, but here we are decades later. I'm still using it, it still works, and it's still getting updated and improved.

Say what you will about JavaScript... I use it constantly not because it's well-designed but because TINA (there is no alternative). [] == ![]; // true. Go ahead. Run it in your console...

...so it basically is `0 == ![]`, in other words, `[].length` which is `0`, thus becomes `0 == false` which returns `true` with loose comparison?

Re: PHP 8.1.0

#105
post #18

Everyone laughing at PHP hasn't tried it for years, I'd bet. It started clumsy, true, but it became a solid and quite elegant way of doing things. And by things I don't mean just web development. The current limitations I see in PHP is that there is not an official multi-core coroutines solution.

Multi core support is an issue I’ve tried conquering with php, but went down a rabbit hole of running JS on a GPU instead.

Re: PHP 8.1.0

#106
post #96

As someone who has worked in a lot of languages and now works in PHP, I think that while PHP still has some of the same warts it did in the old days, I am also understanding that given PHP is, for better or worse, a fundamental piece of web infrastructure, and that providing an upgrade path while also ensuring that they don't just break a large chunk of the web is less a matter of "software conservatism" and more a r…

PHP has done pretty big breaking changes in the past, the thing that immediately comes to mind is register_globals (there are probably others, but my PHP experience is mainly from a decade ago).

Originally GET/POST, cookie and environment values automatically became variables. This means page.php?id=123 gave you a variable $id. Along with no variable declarations, this was intuitive and was probably one of the reasons PHP was so popular with beginner developers. Unfortunately it was also the cause of untold numbers of security bugs, because people would write code like:

    if (securityCheck()) { $isAdmin = true; }
 
    //.... 

    if ($isAdmin) {... }
Someone making the request page.php?isAdmin=true would totally bypass the intended check.

So in April 2002, PHP 4.2 [1] was released that disabled this by default -- but so many (badly written) applications relied on this that it was not until March 2012 -- 10 years later! -- that PHP 5.4 [2] finally removed this option entirely.

[1] https://www.php.net/releases/4_2_0.php

[2] https://www.php.net/releases/5_4_0.php

Re: PHP 8.1.0

#107
post #18

Everyone laughing at PHP hasn't tried it for years, I'd bet. It started clumsy, true, but it became a solid and quite elegant way of doing things. And by things I don't mean just web development. The current limitations I see in PHP is that there is not an official multi-core coroutines solution.

One comment I heard at a programming meetup recently was "I hate how frameworks like laravel have brought PHP back in to popularity when we had the chance to finally kill it off". I do wonder if there really was value in salvaging PHP when we have a wealth of other languages and frameworks that do a perfectly fine job without any of the legacy mistakes sitting around.

Which ones would that have been? Perl? Python? Java? JavaScript?

Among that choice set, PHP is definitely the best contender.

Re: PHP 8.1.0

#108
post #18

Everyone laughing at PHP hasn't tried it for years, I'd bet. It started clumsy, true, but it became a solid and quite elegant way of doing things. And by things I don't mean just web development. The current limitations I see in PHP is that there is not an official multi-core coroutines solution.

One comment I heard at a programming meetup recently was "I hate how frameworks like laravel have brought PHP back in to popularity when we had the chance to finally kill it off". I do wonder if there really was value in salvaging PHP when we have a wealth of other languages and frameworks that do a perfectly fine job without any of the legacy mistakes sitting around.

There isn't a language that can replace php in 2021. Javascript doesn't have the size of build-in library. Golang is compiled and limited, blank spaces/tabs will kill a Python program. Ruby /rails is slower. All are harder to host. What could you replace php with?

The tales of legacy mistakes holding back php are things with no basis in reality. What legacy mistake holds php back? Method names/parameter ordering?

When I started with php in 2001 those elite programmers at meetups were looking down at php because Java was cool. In 2003 those elite programmers thought php should die because asp took over. PHP kept going along quietly taking over the web until the facebook movie came out making PHP cool for a moment. Those elite programmers decided PHP was too mainstream and the why PHP sucked movement started. The elite guys moved to Ruby On Rails then node/MongoDB, angularjs, React, Nextjs leaving each ecosystem for the next hoping that one day they will strike gold.

Re: PHP 8.1.0

#109
post #18

Everyone laughing at PHP hasn't tried it for years, I'd bet. It started clumsy, true, but it became a solid and quite elegant way of doing things. And by things I don't mean just web development. The current limitations I see in PHP is that there is not an official multi-core coroutines solution.

One comment I heard at a programming meetup recently was "I hate how frameworks like laravel have brought PHP back in to popularity when we had the chance to finally kill it off". I do wonder if there really was value in salvaging PHP when we have a wealth of other languages and frameworks that do a perfectly fine job without any of the legacy mistakes sitting around.

Doubt there was a chance to “kill it off”, doesn’t it run over 50% of all websites?

Re: PHP 8.1.0

#110
post #52

Earlier quoted context omitted.

Phabricator, much like WordPress, kind of lives in its own world and hasn't adopted most aspects of modern PHP. Even as someone who works with PHP and enjoys it, I wouldn't want to use Phabricator.

Wordpress has taken great strides to comply with the latest PHP standards so I'd say that's not quite fair to include it here.

I’d disagree, Wordpress is very difficult to work with when you’re used to modern ways of doing things.
Post reply on HN