Live data from Hacker News

PHP 8: Before and After

stitcher.io

1–10 of 346 posts

Re: PHP 8: Before and After

#3
post #2

That first example brings back fond memories of Java 1.5 UI programming.

Well it's a bit different, now the events are sent over the network and if you're using the term event-sourcing you can even consider yourself hip.

Re: PHP 8: Before and After

#5
I'm not up to date on php code, but can't the first example be done using reflection? For example a SubscriberBase class which: lists all of its "on*" methods, checks if there's only one parameter, gets its type via https://www.php.net/manual/en/reflectionparameter.gettype.ph... and registers the method to receive events of that type.

From the docs it looks like it's possible in php7 and doesn't need explicit text mapping. But maybe I'm missing something?

Re: PHP 8: Before and After

#6
It's becoming kind of an Enterprise language [1]. Don't get me wrong I think PHP is getting cooler, hopefully everybody catches up and the fact that You can have a shared hosting for pennies run Your PHP code really puts it at an advantage compared to others.

[1]: https://github.com/joaomilho/Enterprise

Re: PHP 8: Before and After

#7

When can we expect Wordpress to upgrade to PHP 8?

Very soon:

"A long-standing goal of the WordPress project is to be compatible with new versions of PHP on their release day. The next major version of PHP (version 8.0) is currently scheduled for release on November 26, 2020. WordPress Core contributors are working to ensure PHP 8.0 is supported in the next major version of WordPress (version 5.6), which is currently scheduled to be released on December 8, 2020."

https://make.wordpress.org/core/2020/10/06/call-for-testing-...

Re: PHP 8: Before and After

#9

When can we expect Wordpress to upgrade to PHP 8?

I'm not sure why you're asking or what new features you'd like them to take advantage of, but given PHP's reasonable approach to backwards compatibility, I expect that it won't take too much effort to get Wordpress running on PHP 8, but obviously it's not going to utilize much of the new stuff that way.

Re: PHP 8: Before and After

#10
post #7

When can we expect Wordpress to upgrade to PHP 8?

Very soon: "A long-standing goal of the WordPress project is to be compatible with new versions of PHP on their release day. The next major version of PHP (version 8.0) is currently scheduled for release on November 26, 2020. WordPress Core contributors are working to ensure PHP 8.0 is supported in the next major version of WordPress (version 5.6), which is currently scheduled to be released on December 8, 2020." htt…

Possibly not what the author meant. Support for PHP 8 in WordPress will come soon after PHP 8 is released. But to upgrade WordPress to PHP 8, that is to rewrite its codebase to make use of PHP 8 features, probably will not happen anytime soon. WordPress still has a minimum PHP version requirement of 5.6, so...
Post reply on HN