Earlier quoted context omitted.
Reading the list of things that worry them makes it clear that it's not so much php is breaking bc than it is wordpress lack of cleaning and linting for so long catching up to them. I mean seriously the first thing they list as a worry is that arithmetic operators will now throw an error when one (and only one) of their operand is an array or resource (eg array + array support remains, it's really int + array or stri…
It also sounds as though the internal type checking is going to be a large developer load as well. In PHP7, internal functions return null for type mismatches, and in PHP8, they raise a TypeError. This means going back through every case where they call an internal function and wrapping it with a try/catch for TypeError, in addition to checking for null. That sounds like a pretty significant workload change.
PHP 8
241–250 of 273 posts
Re: PHP 8
#242Earlier 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.
To give PHP its due, it can be very fast -- although the more you use it "the modern, right way," the slower it seems to get. I can't help but wonder how much of that is an impedance mismatch between "your program starts over from scratch with every HTTP request" and "structure your program so that by the time every class is instantiated and interface is implemented, ten thousand lines of code have been processed with each request." No matter how great its optimization and caching may be, a Laravel or Symfony app just has a whole lot of overhead relative to any framework in another language that doesn't have PHP's zero-state approach.
Re: PHP 8
#243Earlier quoted context omitted.
> - 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.
A world class VM tied to a dinosaur language in which you still have to escape regex metacharacters.
Re: PHP 8
#244Re: PHP 8
#245I 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?
The article you link to already explains it... ? > The point is, if you look in the announcements and comments about what the JIT does you can pretty much guess why this is kind of the expected result. The JIT compiler improves performance for CPU-intensive work (for example calculating Mandelbrots) but not so much for the "default" kind of applications. We usually don't do all that many calculations.
Re: PHP 8
#246Earlier quoted context omitted.
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.
It's not my favoured governance model, but it is what it is.
Re: PHP 8
#247Earlier quoted context omitted.
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?
Join the php.internals mailing list. The join feature is _really_ unreliable, so that's hurdle number 1.
Put up with the rudeness and insults on the list. This has got better in the (checks diary) last _7 months_. It's a bit more constructive than it was.
Follow the discussions, join the documentation team, make contributions. They won't let you vote until you've done enough to be allowed voting rights. But contributing to the discussions makes a difference.
If you write C or C++ there is so much you can do. There's the barrier of learning the PHP macro language (where I got stuck) but once you get past that you're one of a very select band who can contribute to PHP's source.
Re: PHP 8
#248Earlier quoted context omitted.
"PHP was serverless before there was serverless" However there is a difference: PHP has no deployment system included. But if you build that (not too hard) the difference isn't big ... (But with Lambda&others you outsource the management)
> PHP has no deployment system included. SFTP? I mean, it's not included in PHP, but any linux system has it.
However that's just the technology. You need to build a solution around it, which monitors load and deploys the code as needed and scales down again and eventually in PHP you'd also expect that PHP Session management is integrated ... all doable and people did. The selling point of lambda is "it works" and "not your concern" (with the corresponding downsides)
Re: PHP 8
#249Earlier quoted context omitted.
Same as many web languages, PHP's heyday has a reason as many toolkits at that time were far less powerful and complicated for even simple things. Perl+CGI + all the server setup for a simple dynamic page? It's just unimaginable to many today's developer. I started off with PHP3 and have a very great and hated time with it till v5. PHP for sure is difficult to maintain and very painful to debug, but it's not my reaso…
> Perl+CGI + all the server setup for a simple dynamic page? It's just unimaginable to many today's developer. TBH, I'm still not aware of any truly simple/easy way to get a dynamic HTML page. Recently, I had to make a dumb utility app to render some dynamic data, and I wound up writing a Golang server with the HTML specified as a Go Template. But making it accessible on the publc internet still required spinning up…
If you don’t want to just use some shared hosting, grab any server and use the package manager to install Apache + PHP.
Drop HTML in the web root.
Whatever part of the page is supposed to be dynamic, you can literally just start throwing code in the middle of the HTML, mixing it all together freely.
It won’t be beautiful, but you can go from nothing to this in like 30 minutes or an hour.
Re: PHP 8
#250I 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+