The worst part about PHP is constantly hearing from its detractors, who are often people who haven’t used the language in many years. Haystack needle order, $, fractal of bad design, it just gets old.<p>The language isn’t perfect but I love working with it, these 8.1 and 8.2 improvements have really made it sweet.<p>My biggest gripe at the moment is the (very old) behavior of e.g. preg_match() and sort(). You’ve got a small handful of these common functions that operate on their input by reference/in place which is gross. A new version of these would be welcome.
> PHP 8.2 is a major update of the PHP language.<p>Major update, awesome. /s<p>As someone who manages a network of 250+ WordPress websites - these PHP updates are killing me! As soon as I'm done helping clients upgrade/fix their incompatible themes/plugins and custom code, a new version is out! Even with great tools, the process for about 10% of my network is a nightmare.<p>While I appreciate the work, it's not very satisfying and for many clients very frustrating to pay for something they know nothing about, just to "keep the lights on".
As someone who has written in past a lot of PHP and Python, I find it interesting that PHP devs can do a lot of breaking changes, and don't get a huge amount of flak for it.<p>Python 2 -> 3 change really was painful for Python community, but PHP does these almost fundamental breaking changes so often, that maybe people just get used to it? I haven't really followed Python past version 2, but I think they are less likely to ever do such amount of breaking changes.<p>There must be a lot of unmaintained PHP codebases that will break if PHP is updated by hosting provider etc. Someone must be pulling a lot of hairs because of this.<p>Edit: Those dogpiling there, I rest my case with josefresco's comment:<p><a href="https://news.ycombinator.com/item?id=33907628" rel="nofollow">https://news.ycombinator.com/item?id=33907628</a><p>It's painful. Dropping dynamic properties? That will be a lot of fun. WordPress is probably biggest segment for PHP usage.
I write PHP every day and I don't mind the language at all. It's not exciting per-say, but it's a good tool for the job. My real complaint is about how it's served via Apache and my real problem there is that Apache just depends on a lot of things being in the right place and it can suck for updates since it's harder to keep all things config in your repo. Docker is probably a fix for that, but there's an internal political battle there that I'd rather not touch.<p>I know this is contradictory to what some people love about PHP, but having a directory where everything is isolated and I just run npm start or my go binary or whatever is much easier to reason about for me, rather than also have to think about Apache's end.
I haven't used PHP in almost a decade, but I've been super impressed with what I've seen in the most recent few versions. Looks really cool, it's gotten me tempted to dust it off again at some point
Not as big a leap compared to 8.1 since Nikita left full-time development, but still a good trend. Lots of good changes to types (removing dynamic properties by default, redacted properties, readonly classes, more complex types etc).<p><a href="https://stitcher.io/blog/new-in-php-82" rel="nofollow">https://stitcher.io/blog/new-in-php-82</a>
I think PHP is getting better but... For any greenfield project, I'll not pick it.<p>Also, I'll not pick any of the interpreted languages for that matter and would want Golang/Crystal/Nim to get single binary to be packaged.<p>But of course - this isn't necessarily something everyone would do.<p>There are no right or wrong answers here I suppose.
I need to use PHP at work sometimes. After working in it for a while I still don't love the language and would never pick it for a project myself, but it's overall decent a few quirks aside, and I think a lot of people have built up a habit of disparaging it without actually knowing much about it.<p>That being said, one issue I've found is that while I can use VSCode for every other language, using PHP feels terrible if I'm not using a JetBrains IDE. I tried installing the PHP extension pack, but it was still leagues behind. Is there any guide someone can recommend for making PHP a first-class language in VSCode, or am I stuck in phpStorm?
Many are praising the recent releases of PHP for their quality and performance improvements, and I wouldn't dare argue against that. However, the current release schedule of PHP makes things a little bit difficult for sysadmins. We're now using php-fpm docker containers so that we can (sort-of almost) keep up with PHP updates without doing OS upgrades every single year. A LTS version would be welcome!
I never got it why PHP kept getting bashed even nowadays, it's still the No.1 language for server side web building, Wordpress's market share alone eclipses all its "competitors" such as Nodejs and Django and Flask etc combined then times 100.<p>It's just like the Rust folks never miss any chance to bash C++, while C++'s market share keeps rising and after 16 years since Rust was created, it can not even make 1% of the market while C++ is 12%(excluding C which is 16%,again it keeps rising).<p>Rust's goal by the way should just replace Ada for specific areas, to take on C++ on a broader level it probably needs another few decades, if it can ever make it that is.
8.2 is going to be a stopping point for a lot of projects that rely upon older code that has dynamic properties in classes. It's not a particularly hard fix but I imagine it people will quickly end up in fork/private repo hell as people throw explicit properties on old libraries and cross their fingers.
Deprecated variables in strings? Or just when using the curly braces syntax for some reason? Unlike with every other entry there's no link but this sounds like the biggest change since PHP 4. Anyone know where to find more info?
There is an error in the examples on this release page about traits with constants, it says that<p>return self::CONSTANT; // Fatal error<p>however that is actually allowed, what is an fatal error is<p>return Foo::CONSTANT; // Fatal error<p>compare<p><a href="https://3v4l.org/dIeOk#v8.2rc7" rel="nofollow">https://3v4l.org/dIeOk#v8.2rc7</a><p><a href="https://3v4l.org/11of1#v8.2rc7" rel="nofollow">https://3v4l.org/11of1#v8.2rc7</a><p>Prohibit direct access through a trait name<p><a href="https://wiki.php.net/rfc/constants_in_traits" rel="nofollow">https://wiki.php.net/rfc/constants_in_traits</a>
What's the standard way to install php, by using `brew install php` ? Is there a version manager for php itself to have multiple versions of php in the system ?
the curious thing with php is that while some very notable and impactful projects are using it (besides wordpress you have things like wikipedia powered by mediawiki, nextcloud, moodle etc) somehow this has not translated into creating much press for the ecosystem as a whole nor a sense that its heading somewhere and carving its own valuable niche<p>there is symphony/laravel as web frameworks, which by all accounts are modern and highly usable, but that in itself doesn't distinguish php given how many alternatives exist