TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

PHP 8.2

263 pointsby TimWollaover 2 years ago

19 comments

user3939382over 2 years ago
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&#x2F;in place which is gross. A new version of these would be welcome.
评论 #33907899 未加载
评论 #33908613 未加载
评论 #33907966 未加载
评论 #33909436 未加载
评论 #33907735 未加载
评论 #33911293 未加载
评论 #33908086 未加载
评论 #33910911 未加载
评论 #33907848 未加载
评论 #33908746 未加载
评论 #33910722 未加载
评论 #33907704 未加载
评论 #33911286 未加载
评论 #33922673 未加载
josefrescoover 2 years ago
&gt; PHP 8.2 is a major update of the PHP language.<p>Major update, awesome. &#x2F;s<p>As someone who manages a network of 250+ WordPress websites - these PHP updates are killing me! As soon as I&#x27;m done helping clients upgrade&#x2F;fix their incompatible themes&#x2F;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&#x27;s not very satisfying and for many clients very frustrating to pay for something they know nothing about, just to &quot;keep the lights on&quot;.
评论 #33907703 未加载
评论 #33910354 未加载
评论 #33907681 未加载
评论 #33907655 未加载
评论 #33907987 未加载
评论 #33908144 未加载
评论 #33908941 未加载
评论 #33907676 未加载
评论 #33907670 未加载
评论 #33911309 未加载
评论 #33907701 未加载
Cianticover 2 years ago
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&#x27;t get a huge amount of flak for it.<p>Python 2 -&gt; 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&#x27;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&#x27;s comment:<p><a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=33907628" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=33907628</a><p>It&#x27;s painful. Dropping dynamic properties? That will be a lot of fun. WordPress is probably biggest segment for PHP usage.
评论 #33907775 未加载
评论 #33907604 未加载
评论 #33907646 未加载
评论 #33907727 未加载
评论 #33907649 未加载
评论 #33908283 未加载
评论 #33907656 未加载
评论 #33910857 未加载
评论 #33908251 未加载
评论 #33907804 未加载
评论 #33907765 未加载
评论 #33907714 未加载
jjiceover 2 years ago
I write PHP every day and I don&#x27;t mind the language at all. It&#x27;s not exciting per-say, but it&#x27;s a good tool for the job. My real complaint is about how it&#x27;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&#x27;s harder to keep all things config in your repo. Docker is probably a fix for that, but there&#x27;s an internal political battle there that I&#x27;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&#x27;s end.
评论 #33908434 未加载
评论 #33953727 未加载
评论 #33910634 未加载
评论 #33908372 未加载
评论 #33911896 未加载
vegancapover 2 years ago
I haven&#x27;t used PHP in almost a decade, but I&#x27;ve been super impressed with what I&#x27;ve seen in the most recent few versions. Looks really cool, it&#x27;s gotten me tempted to dust it off again at some point
评论 #33907421 未加载
评论 #33907677 未加载
评论 #33907623 未加载
Dachande663over 2 years ago
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:&#x2F;&#x2F;stitcher.io&#x2F;blog&#x2F;new-in-php-82" rel="nofollow">https:&#x2F;&#x2F;stitcher.io&#x2F;blog&#x2F;new-in-php-82</a>
评论 #33913962 未加载
评论 #33908145 未加载
wg0over 2 years ago
I think PHP is getting better but... For any greenfield project, I&#x27;ll not pick it.<p>Also, I&#x27;ll not pick any of the interpreted languages for that matter and would want Golang&#x2F;Crystal&#x2F;Nim to get single binary to be packaged.<p>But of course - this isn&#x27;t necessarily something everyone would do.<p>There are no right or wrong answers here I suppose.
评论 #33910358 未加载
cehrlichover 2 years ago
I need to use PHP at work sometimes. After working in it for a while I still don&#x27;t love the language and would never pick it for a project myself, but it&#x27;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&#x27;ve found is that while I can use VSCode for every other language, using PHP feels terrible if I&#x27;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?
评论 #33908288 未加载
评论 #33914372 未加载
nixcraftover 2 years ago
PHP 8.2.0 changelog - <a href="https:&#x2F;&#x2F;www.php.net&#x2F;ChangeLog-8.php#8.2.0" rel="nofollow">https:&#x2F;&#x2F;www.php.net&#x2F;ChangeLog-8.php#8.2.0</a><p>PHP supported versions - <a href="https:&#x2F;&#x2F;www.php.net&#x2F;supported-versions.php" rel="nofollow">https:&#x2F;&#x2F;www.php.net&#x2F;supported-versions.php</a>
trey-jonesover 2 years ago
Many are praising the recent releases of PHP for their quality and performance improvements, and I wouldn&#x27;t dare argue against that. However, the current release schedule of PHP makes things a little bit difficult for sysadmins. We&#x27;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!
评论 #33907781 未加载
评论 #33911771 未加载
评论 #33908202 未加载
synergy20over 2 years ago
I never got it why PHP kept getting bashed even nowadays, it&#x27;s still the No.1 language for server side web building, Wordpress&#x27;s market share alone eclipses all its &quot;competitors&quot; such as Nodejs and Django and Flask etc combined then times 100.<p>It&#x27;s just like the Rust folks never miss any chance to bash C++, while C++&#x27;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&#x27;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.
评论 #33908260 未加载
评论 #33912607 未加载
pocketsandover 2 years ago
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&#x27;s not a particularly hard fix but I imagine it people will quickly end up in fork&#x2F;private repo hell as people throw explicit properties on old libraries and cross their fingers.
didipover 2 years ago
PHP seems better now, but what would be the reason to choose PHP when Go, Rust, and Elixir already exist?
评论 #33948189 未加载
评论 #33910185 未加载
Aachenover 2 years ago
Deprecated variables in strings? Or just when using the curly braces syntax for some reason? Unlike with every other entry there&#x27;s no link but this sounds like the biggest change since PHP 4. Anyone know where to find more info?
评论 #33907372 未加载
评论 #33907364 未加载
toredover 2 years ago
There is an error in the examples on this release page about traits with constants, it says that<p>return self::CONSTANT; &#x2F;&#x2F; Fatal error<p>however that is actually allowed, what is an fatal error is<p>return Foo::CONSTANT; &#x2F;&#x2F; Fatal error<p>compare<p><a href="https:&#x2F;&#x2F;3v4l.org&#x2F;dIeOk#v8.2rc7" rel="nofollow">https:&#x2F;&#x2F;3v4l.org&#x2F;dIeOk#v8.2rc7</a><p><a href="https:&#x2F;&#x2F;3v4l.org&#x2F;11of1#v8.2rc7" rel="nofollow">https:&#x2F;&#x2F;3v4l.org&#x2F;11of1#v8.2rc7</a><p>Prohibit direct access through a trait name<p><a href="https:&#x2F;&#x2F;wiki.php.net&#x2F;rfc&#x2F;constants_in_traits" rel="nofollow">https:&#x2F;&#x2F;wiki.php.net&#x2F;rfc&#x2F;constants_in_traits</a>
revskillover 2 years ago
What&#x27;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 ?
评论 #33908238 未加载
评论 #33911251 未加载
评论 #33907833 未加载
评论 #33907800 未加载
评论 #33933409 未加载
tiffanyhover 2 years ago
What’s a feature that PHP is missing, that if it had it - would garner it more respect?<p>Note: I think PHP is way under appreciated.
评论 #33907721 未加载
评论 #33907884 未加载
评论 #33907758 未加载
评论 #33908207 未加载
评论 #33907799 未加载
评论 #33909015 未加载
评论 #33907711 未加载
评论 #33908176 未加载
college_physicsover 2 years ago
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&#x2F;laravel as web frameworks, which by all accounts are modern and highly usable, but that in itself doesn&#x27;t distinguish php given how many alternatives exist
评论 #33911110 未加载
jesuspieceover 2 years ago
People still use PHP? Let this horrible language die already. It&#x27;s banned internally at AMZN for a reason
评论 #33908776 未加载
评论 #33910285 未加载