Live data from Hacker News

PHP 8

php.net

201–210 of 273 posts

Re: PHP 8

#201

I still love you PHP

Me too. For people on shared hosts (hundreds of small websites including small businesses), PHP is pretty much the only server-side language that you have access to (well, maybe aside from Perl).

Re: PHP 8

#202

I wonder what makes the Symfony Demo App not being faster with the JIT compiler (as shown on https://www.php.net/releases/8.0/en.php and https://susi.dev/php8-benchmark-jit-symfony ). Maybe because Symfony already caches things very efficiently/cleverly with OPCache?

Mostly because only cpu-intensive code greatly benefits from JIT. Serving a blog (like the demo) is not much cpu-intensive.

OO heavy code and functional heavy code can also benefit greatly from JIT compilation. The PHP8 JIT just doesn't have these optimizations yet.

Re: PHP 8

#203
post #12
post #6

> 0 == 'foobar' // true That's PHP7 behaviour that's updated in 8 to return false. I'm not a PHP basher, I really like it these days, but why the heck was that example ever evaluating to true?

I suspect they copied that behavior from Perl.

Perl avoids this problem by having contexts, a bit like casts but with easier syntax, and by having separate numeric and string equality operators.

Re: PHP 8

#204
post #62

How 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…

Modern PHPs shining light is the Laravel framework and the ecosystem built up around it. If you're going to start a database-driven website projects in PHP there really isn't a good reason to not use and learn Laravel (or Lumen if you want something more lightweight). That being said if you're not tied to PHP I'm not sure I'd necessarily recommend it. The obvious alternatives worth looking into are Ruby on Rails or P…

> PHP there really isn't a good reason to not use and learn Laravel (or Lumen if you want something more lightweight).

12 year professional PHP developer (in that it's been my main language, I've also written a lot of C# and TypeScript in that period) - I'd pick Symfony for any project I knew was going to last more than a few years before the inevitable re-write.

The problem is you don't see the difference until you've seen multiple large codebases implemented in both frameworks.

Symfony is harder to bootstrap a project with (though not really that true since 5) but in nearly every other way it gets more right than wrong.

Re: PHP 8

#205
It seems like an amazing release. I've not touched PHP code for at least 5 years but it makes me want to play with it again :)

Re: PHP 8

#206
post #4

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-...

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.

Re: PHP 8

#207
post #4

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-...

WordPress core team members and users are welcome to get involved in PHP development and providing feedback on proposals. They are notably absent, and so people who write modern PHP - or wish PHP was a different language - are the ones influencing language development.

Having no stake in this, I think that's a mistaken way of going about things. Wordpress is PHP's killer app. If people aren't getting involved, php team should consider outreach.

Re: PHP 8

#208
post #12

Earlier quoted context omitted.

I suspect they copied that behavior from Perl.

Perl avoids this problem by having contexts, a bit like casts but with easier syntax, and by having separate numeric and string equality operators.

Is there a reason returning undefined instead of true in those cases (string doesn't look like a number) would be worse?

Re: PHP 8

#209

React 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

#210

Facebook’s backups were written in PHP. Well, the second version was, anyway. (The first version didn’t work so well.) By backups, I mean the central MySQL databases with profile and post information; not media or messages. The “Crown Jewels,” so to speak. It was written by an engineer in a week or so and then handed off to me. I was a storage guy with some programming chops. Fewer chops than I thought. Multiprocess,…

Did you use those backups often?

Why? Have you lost some "friends"?
Post reply on HN