Apparently some of the deprecations will make this the most backward compatibility breaking version jump of PHP since V4 to V5. (Read a german interview here: https://www.heise.de/news/PHP-8-im-Experten-Check-Der-erwart... ) There's a long report on Wordpress and PHP 8 and it's not pretty: https://developer.yoast.com/blog/the-2020-wordpress-and-php-...
PHP 8
221–230 of 273 posts
Re: PHP 8
#222Earlier quoted context omitted.
Just tried it on a Laravel project I'm working on, on Windows. Worked flawlessly. On the downside, no noticeable performance improvements. Report generation times: PHP 7.4 = 67ms avg PHP 8.0 = 66ms avg This is getting the data from MySQL and massaging it for the templates. With Laravel's insane amount of indirection, of course.
Why would you expect performace improvements? Because of JIT? There's no reason to hope that JIT would help with that much, because it's I/O-bound anyways. And function calls in PHP are pretty efficient.
https://www.fonow.com/Images/2020/0608/9f3a0f6a4f8f2ee.png
Re: PHP 8
#223Earlier quoted context omitted.
> I was surprised to learn that other languages didn't work the same way, when integrating into a web server Oh boy... I'm still not sure how you deploy a non-PHP webserver to be honest... every language seems to be doing something different, with php you just needed to drag & drop your files in the "public" folder.
> I'm still not sure how you deploy a non-PHP webserver to be honest... every language seems to be doing something different Coming from PHP and having used a bunch of different languages I can understand what you are saying. Unlike PHP, the other languages run in a process that listens on a port (80, 443 or another). The single process continuously run and handles multiple requests. Back then, I still had to use NGI…
Re: PHP 8
#224Where's the best place to suggest a new feature or improvement for PHP? I've always wanted to see `foreach` get a built-in iterator/counter so you don't have to create and use a counter variable manually. Current way: $i=0; foreach ($array as $key => $value) { echo "Loop $i of " . count($array); $i++; } Possible new way: foreach ($array as $key => $value, $i) { echo "Loop $i of " . count($array); }
foreach ($iter = new IndexingIterator($array) as $k => $v) {
echo $iter->index();
}Re: PHP 8
#225Re: PHP 8
#226React php is worth checking out. Async stuff like websockets and non blocking redis subscriptions.
ReactPHP and all the other "async" frameworks became obsolete the moment Swoole entered the game.
Re: PHP 8
#227Earlier quoted context omitted.
> And so people who ... wish PHP was a different language are the ones influencing language development. That's definitely been my impression. I used to be a professional PHP developer, still use it occasionally for personal projects, and appreciate the language, warts and all, even if I can't truly say I love* it -- but I'm only half-joking when I quip that PHP has evolved from its roots as a cargo cult version of P…
> - but I'm only half-joking when I quip that PHP has evolved from its roots as a cargo cult version of Perl into a cargo cult version of Java. It's a joke in so far as it is funny - but it's absolutely correct. When you only look at the language... When looking at the VM, Java has an absolutely world class VM, with great engineering and decades worth of research poured into it. PHP has... no such thing.
That is completely ignored by the community
Re: PHP 8
#228How should one start learning with PHP these days? My experience: hacked together a few PHP scripts over the years to notify me of a website change (5 minute cron job). Before that, I was a very good beginner with VB6 back in highschool. There are a couple of ambitious database-driven website projects I would like to create, but I don't know where to start. I like the KISS philosophy, and I think PHP and MySQL would…
>w3schools PHP tutorial I think a better approach is to think of a (very basic) project you want to create, and then claw and bite your way through it, until you have something that works. Then think of a way to enhance it, and go though the process again. Slogging through a tutorial is boring, and you have nothing to show for it when you're done. PS: Don't listen to sneaky JavaScript evangelists. Wicked! Tricksy! Fa…
Re: PHP 8
#229Earlier quoted context omitted.
Why would you expect performace improvements? Because of JIT? There's no reason to hope that JIT would help with that much, because it's I/O-bound anyways. And function calls in PHP are pretty efficient.
PHP 8 performance improvements were advertised https://www.fonow.com/Images/2020/0608/9f3a0f6a4f8f2ee.png https://www.fonow.com/Images/2020/0608/4e9d2337edd2072.png https://www.fonow.com/Images/2020/0608/70a1c6cff23f4fc.png
And, yeah, performance improvements are always advertised.
Re: PHP 8
#230Apparently some of the deprecations will make this the most backward compatibility breaking version jump of PHP since V4 to V5. (Read a german interview here: https://www.heise.de/news/PHP-8-im-Experten-Check-Der-erwart... ) There's a long report on Wordpress and PHP 8 and it's not pretty: https://developer.yoast.com/blog/the-2020-wordpress-and-php-...
"There's a long report on Wordpress and PHP 8 and it's not pretty" I wonder if that's somewhat on purpose. Part of the remaining stigma with PHP is that people cite bad PHP examples from WP.
I think the other reason non PHP devs think we are in the dark ages is because when they google it, our documentation looks like it's from 2010. It's a bit of a joke really.