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 in 2021

279 pointsby nowandlaterabout 4 years ago

20 comments

ashton314about 4 years ago
Before you call me a troll, know that I worked with PHP for two+ years maintaining both legacy codebases and writing new code with Laravel.<p>My question is: why would anyone want to start something new with PHP in 2021? Is there anything that it does better than any other language&#x2F;ecosystem? I feel like the community is full of (but not exclusively composed of—there are some gems like Caleb Porzio who write good stuff) people who just care about hacking something together and, as long as it works, it&#x27;s fine. They care nothing about elegance and have but a dim conception of larger CS&#x2F;SE principles.<p>For example, why would you write something in PHP when you&#x27;ve got an excellent choice between Ruby&#x2F;Rails or Elixir&#x2F;Phoenix&#x2F;LiveView, both of which are fantastic, and, especially in the case of the Elixir&#x2F;Phoenix stack, <i>really</i> developer friendly, easy to set up and deploy, etc. and also have solid foundations?<p>I&#x27;m glad to see PHP getting better—it will certainly improve life for those maintaining old PHP projects that are agile enough to upgrade—but I really see no reason to not choose a better tool in this day and age.<p>(You may now call me a troll if you see fit. I stand by what I said though. :-)
评论 #26830287 未加载
评论 #26830054 未加载
评论 #26830450 未加载
评论 #26830602 未加载
评论 #26829600 未加载
评论 #26829506 未加载
评论 #26831604 未加载
评论 #26829496 未加载
评论 #26830757 未加载
评论 #26829589 未加载
评论 #26829930 未加载
评论 #26832057 未加载
评论 #26832663 未加载
评论 #26830616 未加载
评论 #26833613 未加载
评论 #26831717 未加载
评论 #26831045 未加载
评论 #26832186 未加载
评论 #26830563 未加载
评论 #26832654 未加载
评论 #26830019 未加载
评论 #26832446 未加载
评论 #26830762 未加载
评论 #26831240 未加载
评论 #26829824 未加载
评论 #26831206 未加载
评论 #26830797 未加载
评论 #26837134 未加载
评论 #26830705 未加载
评论 #26830619 未加载
评论 #26832315 未加载
评论 #26832148 未加载
评论 #26830802 未加载
评论 #26835499 未加载
评论 #26897789 未加载
评论 #26830826 未加载
评论 #26830278 未加载
评论 #26833948 未加载
评论 #26830128 未加载
评论 #26832140 未加载
评论 #26841784 未加载
评论 #26830624 未加载
评论 #26831391 未加载
评论 #26830236 未加载
cardanomeabout 4 years ago
It is a great language to put food on the table.<p>Especially in Europe it is still the dominant backend language. If you want to have flexibility on where you work it is a good language to know.<p>You have the productivity of a scripting language but still great static analysis tools that help you out. It really fills a sweet spot that no other language does.<p>Yes, Node has Typescript but then you have a super slow compiler negating the scripting language benefits. With PHP I can change a file and see instant results. Also languages like Go make it hard to debug anything on an live server as it is all compiled.<p>PHP code is mostly boring. The coding style tends to be very pragmatic. Even bad beginner code runs great due to dead code elimination and the like. Shared nothing architecture makes understanding and debugging the system so much easier.<p>Hosting is simple and inexpensive. Beginner can just copy their files to an shared hoster and be done with it.<p>PHP is only a bad choice is you have really complex requirement and need a high level of reliability, which most Web projects don&#x27;t. I think Haskell fills a good niche here. It is really underestimated. Also Elixir if you happen to build anything where you can play out its strength.
评论 #26830312 未加载
评论 #26832130 未加载
评论 #26830899 未加载
busterarmabout 4 years ago
PHP has been in a pretty good place since 7, IMO. These are some great developments.<p>I would say that Laravel is an extremely high quality framework (on par with and even in some ways better than Rails) that nobody should be ashamed to use.<p>It&#x27;s unfortunate that the stink of old PHP is so powerful and that salaries are still lagging so far behind.
评论 #26829417 未加载
评论 #26827921 未加载
评论 #26828221 未加载
评论 #26830836 未加载
评论 #26827777 未加载
评论 #26831833 未加载
评论 #26828452 未加载
anwabout 4 years ago
It&#x27;s nice to see PHP adding useful things like enums and async (green threads). My foray into Web development started with Perl, but quickly segued into PHP with how much simpler it felt. The ability to hop into vim on your server (or use CPanel back in the day) and edit your site live was exciting back then – but now that very thought makes me shudder with what could go wrong, haha.<p>While I&#x27;ve moved onto JVM languages and Rust professionally, I do hope PHP will continue getting future generations excited about Web development and building out their ideas quickly.<p>FYI: Not sure if the author will see this but some spelling mistakes in the article. [0] E.g. s&#x2F;reslease&#x2F;release&#x2F;<p>0. <a href="https:&#x2F;&#x2F;stitcher.io&#x2F;blog&#x2F;php-in-2021#the-community" rel="nofollow">https:&#x2F;&#x2F;stitcher.io&#x2F;blog&#x2F;php-in-2021#the-community</a>
评论 #26829064 未加载
评论 #26828521 未加载
评论 #26828391 未加载
genmonabout 4 years ago
PHP has astounding longevity. In maintaining my personal websites (static pages, web toys, projects with my writing groups), I always ask myself: how will I keep this running in 20 years?<p>It&#x27;s unrealistic to think that languages will stay static over 20 years -- servers get rebuilt, old versions languages get deprecated, frameworks disappear. So the question becomes<p>- will I know how to fix or rebuild this, even if I don&#x27;t touch the code more than once every 5-10 years? - what is sufficiently resilient to mean that &quot;mean time between rebuilds&quot; is as long as possible?<p>Over all that time, what&#x27;s lasted best are CGIs (Python&#x2F;Perl) and PHP, running behind Apache.<p>I don&#x27;t use PHP day-to-day, so changes in the language don&#x27;t affect me much. But for keeping the history of the web alive, it is an unparalleled tool, and its proven commitment to longevity is why I still reach for it.<p>Separately: I think that longevity is a question we should ask ourselves more about the web. New ideas often come from experiencing old (even failed) ideas -- but if those old ideas just disappear, we lose some of our ability to progress.
评论 #26831209 未加载
评论 #26831273 未加载
chxabout 4 years ago
In a post called &quot;PHP in 2021&quot; we really can&#x27;t omit <a href="https:&#x2F;&#x2F;bref.sh&#x2F;" rel="nofollow">https:&#x2F;&#x2F;bref.sh&#x2F;</a> -- it allows running PHP apps on AWS Lambda effortlessly. With all the serverless craze, it&#x27;s a very important piece of the ecosystem. After writing PHP apps for two decades, I am absolutely stunned how easy it is.<p>Amazon blogged about it at <a href="https:&#x2F;&#x2F;aws.amazon.com&#x2F;blogs&#x2F;compute&#x2F;the-serverless-lamp-stack-part-3-replacing-the-web-server&#x2F;" rel="nofollow">https:&#x2F;&#x2F;aws.amazon.com&#x2F;blogs&#x2F;compute&#x2F;the-serverless-lamp-sta...</a>
评论 #26832864 未加载
评论 #26828770 未加载
评论 #26828440 未加载
评论 #26828643 未加载
bouncycastleabout 4 years ago
&gt; Still no support for generics, unfortunately<p>Huh? PHP is a dynamic language, you already have them in principle.<p>Usually you can just have no type and use instanceof, but also requiring the parameter to be an interface does the job in most cases if you need more clarity.<p>Edit: There&#x27;s also method_exists! Also a whole heap of other tools in the toolbox <a href="https:&#x2F;&#x2F;www.php.net&#x2F;manual&#x2F;en&#x2F;ref.classobj.php" rel="nofollow">https:&#x2F;&#x2F;www.php.net&#x2F;manual&#x2F;en&#x2F;ref.classobj.php</a>
评论 #26828632 未加载
评论 #26829811 未加载
timw4mailabout 4 years ago
When 7.4 was released, with FFI now available, I had the crazy idea to make a cli text editor in PHP[1] (based on kilo[2], and since 8 has come out, with the addition of the PHPToken class, highlighting PHP with PHP has gotten easier.<p>1. <a href="https:&#x2F;&#x2F;git.timshomepage.net&#x2F;timw4mail&#x2F;php-kilo" rel="nofollow">https:&#x2F;&#x2F;git.timshomepage.net&#x2F;timw4mail&#x2F;php-kilo</a> 2. <a href="https:&#x2F;&#x2F;viewsourcecode.org&#x2F;snaptoken&#x2F;kilo&#x2F;" rel="nofollow">https:&#x2F;&#x2F;viewsourcecode.org&#x2F;snaptoken&#x2F;kilo&#x2F;</a>
yeskiaabout 4 years ago
As someone who works with Rails and Laravel, one of the huge benefits I find working with PHP&#x2F;Laravel are the speed and consistency of releases. PHP seems to release versions more frequently, and Laravel tags every week. It means there&#x27;s much less lead time to work with new features&#x2F;functionality as it becomes available (when it&#x27;s stable, rather than running on edge).
评论 #26829935 未加载
pdentonabout 4 years ago
My beef with PHP is not so much the language itself, but the weird community that surrounds it.<p>The FIG standard that forbids TAB for indentation (which is perfectly legal in PHP), the notion that classes should be either abstract or final, the micro-optimizations (thou must use single quotes, things like that).<p>I don&#x27;t think anyone can tell anyone how to write PHP, because nobody knows how to get it right (myself included). Yet in my many years of coding in PHP, there&#x27;s been more and more tooling and so-called &quot;standards&quot; that do exactly this.
评论 #26828792 未加载
评论 #26828387 未加载
评论 #26828065 未加载
评论 #26828409 未加载
评论 #26828435 未加载
评论 #26830546 未加载
评论 #26828694 未加载
评论 #26828397 未加载
评论 #26828110 未加载
gusbremmabout 4 years ago
I wish there was a nodejs equivalent to Laravel
评论 #26829172 未加载
评论 #26828328 未加载
评论 #26828810 未加载
评论 #26830265 未加载
评论 #26828237 未加载
评论 #26828572 未加载
评论 #26830020 未加载
codingclawsabout 4 years ago
I like PHP but dislike the PHP frameworks.
评论 #26837696 未加载
Ambixabout 4 years ago
I used to work both with Go and PHP.<p>At first when I started digging into Go I thought that eventually I&#x27;ll replace platform for all my future PHP projects. But it never happened.<p>Every time I should implement business logic and info exchange with database I immediately became frustrated with so much boilerplate code of Golang. In comparison, writing such code in PHP is real breathe.<p>But suddenly I&#x27;ve got used to Go speed and want to get the same benefits for my PHP APIs. So I&#x27;ve implemented my own framework with low latency and hight throughput in mind. It beats many Go frameworks on TechEmpower Benchmarks! Now I feel like I found epiphany finally :)<p><a href="https:&#x2F;&#x2F;github.com&#x2F;gotzmann&#x2F;comet" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;gotzmann&#x2F;comet</a>
hunter-2about 4 years ago
I am not a programmer, and I have hired developers to build websites for me for close to 15 years now.<p>I love PHP. Two reasons. One, because this was the language I learned to code when I started off. So, it&#x27;s easy for me to understand stuff my developers tell me.<p>More importantly, the language is so mainstream that the developers I work with are quite cheap to hire. The more sophisticated a language is, the fewer the programmers available for hire, which shoots up the costs with no visible changes to me on the front-end.<p>I&#x27;m currently building a simple search-engine like project - all on PHP. We have been testing it right now, and it&#x27;s fast and usable - and I am not regretting my decision to use PHP for this; yet.
brianzelipabout 4 years ago
I’m primarily a javascript dev who had to dive into php and wordpress this past year for a client.[0] The php docs often drive me nuts with their range of what info and examples are available per feature, and the language’s naming can be funny at times with a lack of consistency...<p>But I really like it. Php writes and reads like javascript. And working with dates has actually been pretty fun - I like the natural language manipulation layer it provides, ie: `last Sunday`, etc. And the built in url parsing.<p>I’m happy to have added it to my tool belt!<p>[0] <a href="https:&#x2F;&#x2F;www.zionbaltimore.org" rel="nofollow">https:&#x2F;&#x2F;www.zionbaltimore.org</a>
keb_about 4 years ago
I no longer use PHP, but I have to say, I truly appreciate the regular articles on the state of PHP by @brendt_gd. I think they&#x27;re absolutely awesome, and I wish I could get the same kind of regular rundowns for Python, for example. :)
mmckeenabout 4 years ago
So basically PHP is still catching up to Hack and but not quite there yet?
评论 #26828453 未加载
评论 #26830452 未加载
评论 #26828350 未加载
o_pabout 4 years ago
Daily reminder that by Lindy effects, for each additional year of php still alive the probability of staying alive increase. We will probably die before PHP
knorkerabout 4 years ago
&gt; All of that to say: PHP is alive and doing very well.<p>Oh. I was hoping for good news. :-(
eric4smithabout 4 years ago
I know PHP is really great (and always has been).<p>But sh*t, there is soooo much bad, no, really really bad PHP code that lives out there.<p>Isn&#x27;t it?
评论 #26831261 未加载
评论 #26830291 未加载
评论 #26829043 未加载
评论 #26828404 未加载
评论 #26828329 未加载