Live data from Hacker News

PHP 8

php.net

171–180 of 273 posts

Re: PHP 8

#172
post #39

Does PHP still has that weird flow where each request is its own process? afair PHP never had an http server baked in, I remember nginx with php etc ...

By weird flow do you mean “shared nothing by design”?

Re: PHP 8

#173

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

I met Haiping at the HipHop pre-launch thing where they brought some non-facebook-folks in to learn about it. I really liked him.

Re: PHP 8

#174

Earlier quoted context omitted.

It's a switch statement that's an expression . That's a nice ergonomic improvement when you want to assign the result to a variable. Especially as it allows you to use a non-mutable variable whereas otherwise you'd have to make it mutable.

I wouldn't compare it to a switch statement, because a switch statement - even though it looks similar - has fundamentally different control flow.

[deleted]

Re: PHP 8

#175

I get paid for writing PHP code, and the quality of the official PHP documentation worries me. I've searched for several of the changes introduced by the 8.0 version, and I could not find them. For instance, the page titled "Function arguments" does not mention the existence of named arguments. The last time I wanted to submit a ticket about a documentation bug, I saw that the ticket was already created months ago. I…

The PHP project is severely underresourced. One or 2 core devs are sponsored by their employer to work on the project; everyone else is volunteering, and the pool of people isn't as large as it once was. And that's for developing PHP itself. Documentation needs people too (there are many arguments for and against adding features without documentation) and the team would welcome new members.

Interesting, I had no idea. What could an individual like myself do to help this situation?

Re: PHP 8

#176
post #145

I can't believe nobody has pointed out (yet) that PHP is the quintessential lambda :) That said, it's been many (many, many!) years since I moved away from it, but I'm intrigued by the state of the JIT and the current coding style (last time I checked, around 6.x, it was growing to be verbose and full of backslash-adorned-namespacing).

PHP 6 was never released, you are probably thinking of 5.3+

Re: PHP 8

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

> 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 Perl into a cargo cult version of Java.

Re: PHP 8

#178

Earlier quoted context omitted.

I think I had issues even with mbstring, for some characters like "œ". But maybe I'm wrong.

œ works fine with mb_strlen(). What might have been tripping you up is combining character sequences: https://3v4l.org/DM4pC Handling those "correctly" with a string length function gets complicated in any language, as there isn't a 1-to-1 mapping between Unicode codepoints and visible glyphs.

In PHP grapheme_strlen achieves what you're describing: https://3v4l.org/HPOb3

Re: PHP 8

#179
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…

I could just never get used to Ruby syntax and how wordy it is.

PHP/C/perl-style syntax just feels much nicer/more natural to write and I've never been able to break out of that.

I guess it comes down to personal preference and what you started coding with.

Re: PHP 8

#180
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…

Is Laravel better than Symfony? When I used PHP, the Symfony components were the best in the ecosystem.
Post reply on HN