15 ms·
An Internet of PHP
- emodendroket 3y agoI feel like a lot of this is mostly a commentary on WordPress.
- kijin 3y agoWhich it should be, since WordPress is such a huge part of the PHP ecosystem. Laravel is a distant second. To talk about PHP without mentioning WordPress, whether in a good light or not, would be like discussing Ruby without mentioning Rails.
- emodendroket 3y agoNo doubt but it calls into question some of the reasoning in the article about PHP itself being so great. Like, people write a lot of VBA because of Office but I would not conclude that that’s because VBA is such an excellent environment to work in and more because Office is a great product and VBA is how you interact with it.
- ekianjo 3y agoThe article addresses that so no
- emodendroket 3y agoWhere? The article left the impression with me that without Wordpress the numbers would be less impressive.
- deleted 3y ago[deleted]
- deleted 3y ago[deleted]
- kyriakos 3y agoI love and use php but this article feels more like propaganda.
- deleted 3y ago[deleted]
- aaviator42 3y agoThere's a lot and hate of criticism of PHP out there, so some praise and sane opinions are nice to balance it out.
- kyriakos 3y agoHate almost always comes from people who haven't used PHP in a very long time or touched it briefly at some point. Fanboyism serves no purpose. Experienced developers understand that programming languages are just tools each with their own trade-offs.
- rvnx 3y agoA good programmer doesn't really care about the langage itself, but rather whether the language is the right tool for the job. For example, Erlang is painful to adapt to, but in some cases (example: if you build a Messenger app) it will be the best. It doesn't mean that Erlang is a bad language at all, it is designed for a main purpose in mind. It's normal to see junior developers and low-quality packages in PHP, JavaScript, Java or Python, it's because these languages are well-documented and rather accessible. There is no point in making a language needlessly complex.
- kyriakos 3y agoIt's not any different to my point. You can use a hammer to hammer in a screw it doesn't make it fit for the job but it will work up to a certain extend. Similarly you can make a messenger app in PHP but you are better off using Erlang or maybe Node.
- cloudking 3y agoAt the end of the day if your software works and users like it, does the programming language even matter?
- kyriakos 3y agoIt's very unlikely these days for a medium sized and above software project to be written 100% in a single language.
- kxrm 3y agoI agree that it should not matter but there are people out there who really have strong feelings about PHP. I understand those strong feelings because PHP was very popular since it was on every shared host and it was super easy to quickly whip up scripts that render dynamic pages back in the day. That ease had consequences that PHP is trying to dig out from under to this day. I personally reach for PHP first for all my personal web projects. It's where I am most comfortable. I write C++, Rust, Python, C#, and JS in various capacities both personally and professionally and I always go to the first language I learned whenever I want to prototype, PHP. That said, I agree with the sentiment you are expressing. If the app works, and people enjoy using it, the underlying language only matters to other devs who might work on it and that is it.
- trilbyglens 3y agoStill do this day I don't know of any serverside language that you can just drop files into to update.
- quickthrower2 3y agoNext.js is a bit like this. In at least it does the 1-1 file to route mapping. Not drop in on the server but is so on the dev machine.
- wiseowise 3y agoIf you do it 40 hours a week - absolutely.
- jalapenos 3y agoI've always liked PHP. You wouldn't pick it for your job interview's coding test if you had a choice (Python all the way there), but it's so intertwined with the internet and what we've learned about programming over the years. First mover advantage kind of deal. And I've never had to deal with ESM/CJS/AMD whatever module nonsense with PHP. No transpiling anything, just edit and refresh. And so many useful functions out of the box (array_column anyone?). I think its bad rap comes from its ubiquity. Pretty much any existing website I've had to work on has been a putrid mess. That's just the way codebases go unless you're a SaaS with a CTO who's hell bent on preventing that. And since most of these putrid messes have been based on PHP, due to it's age and ubiquity, people blame it, due to observation bias.
- gleenn 3y agoBad rap comes from the inconsistency of the early APIs. The ability to interleave code and HTML was also tacky and never taken seriously but I think touted highly by some as a killer feature. The language is very unplanned, go look at an equality chart for PHP, it makes JavaScript blush as well.
- iLoveOncall 3y ago> The ability to interleave code and HTML was also tacky and never taken seriously And yet people would take a bullet for React and the JSX templates.
- jalapenos 3y agoFunny how "server side rendering" became a hot new thing too. I was so confused when I heard that, "like... a HTML file?". Keep going at this rate and we'll be using frames again.
- jiggawatts 3y ago> using frames again. That’s pretty much what htmx is…
- 3y ago
- zebomon 3y agoI learned how to code when I was a kid with a mixture of C++ my dad showed me on our Dell running Windows 95 and PHP that I taught myself in the years after. All through my teenage years into my early 20s, anything I wanted to make I made in PHP. I still have some PHP projects online, but recently when I want to make anything, I set up an API in Python and build the front with a JS framework. Is part of this just getting in on the latest trend? Definitely. I like scrolling through trending on Github, ya know? But I was also just tired of writing PHP. Python is cleaner, so if I can do the more complex backend stuff in that, coding is more fun. I would say PHP and JS are about equally “unclean” but if it’s just frontend all those brackets and parentheses don’t become an issue as much. Just one experience.
- iLoveOncall 3y agoI'm sorry but if your only reason why PHP and JS are less "clean" than Python is because they have brackets and parenthesis, you're sharing your inexperience, not your experience.
- zebomon 3y agoI meant "all those brackets and parentheses" as a synecdoche. I definitely don't mean my opinion to be a comment on any of the actual technical benefits of JS/PHP/Python. Just explaining the reason I've most recently preferred the act of writing one over the other.
- asddubs 3y agojavascript is way worse in cleanliness. PHP has the advantage of having been able to break backwards compat and fix some of its worst messes, even down to some questionable soft equalities. Also PHP nicely sidesteps the string addition/concatenation problem by having a dedicated operator for concatenation.
- zebomon 3y agoFair enough!
- 3y ago
- nunodonato 3y ago"PHP is dead" is dead. The amount of people praising PHP these days is quite high and increasing. Of course I may also be in a bubble (of php devs), but I have seen a constant increase from JS-people starting to look (and in some cases, convert to) php. Also, many new youtube videos highlighting the new stuff in the language, how modern it is, etc. Honestly, anyone that blindly criticizes or dismisses php these days, is a big red-flag for me.
- jbverschoor 3y agoWell the problem is that "the internet" (google, stackoverflow) does not (by default) filter out any old/obsolete information. People googling for solutions will get 30+ year old "advise" on how to do certain things / use certain libraries etc. Especially StackOverflow should be incorporating a major version number for which the question is valid. So yes, "PHP is still dead" as long as you get the same old advise.
- nunodonato 3y agothat's very true. But it is true for PHP as it is for any other language or tech that is at least a decade old. Interesting fact: chatgpt can recognize old stuff and give better recommendations
- jbverschoor 3y agoStill, somehow it’s more true for php.. maybe because other languages invest more in migrating to newer standards. Maybe because so many projects are self-hosted by non-programmers, in which case it makes sense to be conservative
- gregjor 3y agoCan you name one or two "newer standards" that "other languages" have invested more in migrating to, compared to PHP? Did you mean standard, as in HTML5 or ES6? Or something more like a fashion or fad, like FP or OOP (which PHP has had for a long time)? People ask the same old questions about PHP on StackOverflow et al. because a lot of people start with PHP and as beginners they will have the same questions every beginner had before them, and the same lack of ability figuring things out themselves or finding their questions already answered. That has nothing to do with PHP per se except that PHP offers a very easy on-ramp to getting started with web development, so a lot of newbs start there. If you look at the W3Techs methodology, posted on their site for all to see but apparently few to bother with, you will see that self-hosted hobbyist and learning projects aren't going to make it into their results.
- iLoveOncall 3y ago> Slack uses PHP for most of its server-side application logic […]. > the advantages of the PHP environment (reduced cost of bugs through fault isolation; safe concurrency; and high developer throughput) are more valuable than the problems […] The "high developer throughput" is really what does it for me. I remember vividly when I started at Amazon (where PHP is forbidden) and we were spending days building a single relatively basic CRUD endpoints in Java (with Hibernate, that sucks for non-trivial models), I was constantly thinking "this would have literally taken 1 minute and 5 lines of code with Laravel". You want your whole team to become 10x developers? Switch to PHP. Between the simply incomparable frameworks that do absolutely all the work for you and the fact that a simple instant page refresh shows your changes, productivity is multiplied.
- anonymous344 3y agophp runs securely in 5minutes in any web server 3-10$/month. Every other tech, it's complicated servers or complicated billing, not to mention depencies and build tools. thats why php
- quickthrower2 3y agoNot sure why it is downvoted as this is true. That said it is more to do with shared hosts culture choosing PHP than PHP itself. (They tend to support Ruby and Node but not as well)
- nasretdinov 3y agoPHP is also pretty easy to support for shared hosting, as what they essentially need is just an Apache module (+ nginx probably), some clever filesystem permissions and they're done. For node, Python, etc, you actually need to keep the application servers running, which has to stay running even when they're completely idle. So I think PHP is a natural choice for shared hosting for those reasons too.
- oaiey 3y agoThis is exactly to the reason why PHP and before perl are successful in this space. When you extrapolate that to modern tech, you could create a shared hoster with a configured reverse proxy and per customer docker images. But that is so much expensive to build, operate and bill than an apache. And looks very close to AWS and friends.
- azlev 3y agoI worked 10+ years in a web hosting company. PHP was chosen not because it was easy, it's because most people just use a CMS or something in PHP. Keep a shared host secure, PHP or something else was not an easy task, most people installed unsecure versions or misconfigure something. Also it was a pain to support PHP versions after EOL (yes, money), and multiple versions .
- xigoi 3y ago
- Andrew018 3y ago[flagged]
- brendamn 3y agoFrom W3Tech; > PHP is used by 77% of all the websites whose server-side programming language we know. I had a quick look at the methodology section, but it’s not clear to me how accurate this data is. Determining whether a site uses PHP can be relatively straightforward (especially with default extensions / if Wordpress is used / etc), but if a site (potentially using a different language) is behind a reverse proxy/uses an API/etc then it is less clear. Does anyone know whether PHP is over-represented in the results because it’s easy to identify? No doubt PHP is still huge, but 77% seems almost too huge. There is also a very good chance that PHP is actually that big and I’m just in a different crowd.
- seangrogg 3y agoIdle musing, but this is likely correct. If someone who isn't tech-minded is throwing together a quick blog in WordPress or something chances are they aren't going the extra mile to change the headers or add a reverse proxy just to obfuscate that they're using a stock WordPress install.
- chrisandchris 3y agoSaying 77% of the web is run by PHP and concluding therefore that PHP is well-liked for websites is like telling most of banking is run in COBOL and therefore COBOL is well-liked for banking. The conclusion has no coherence to the source. I guess that most of the web runs on PHP (because it runs on Wordpress) if counted by page-view. But I'm not sure that's the proper measure.
- gregjor 3y agoIn default configuration PHP identifies itself in response headers, but you can turn that off. People who know how to set up and administer web back ends generally do that from a security best practice checklist. So if anything PHP runs more sites than the number discovered crawling the web looking for identifying evidence. Wordpress and similar CMSs, e-commerce platforms, and the Laravel framework give themselves away in other ways that take more work to hide. Likewise non-PHP back-ends have easy to see fingerprints in the headers and page source. There’s no reason to think PHP appears to dominate because crawlers can easily identify PHP but can’t identify other back-ends. Banks and large companies with large COBOL code bases mainly maintain their legacy code, they don’t write a lot of new code in COBOL or RPG. And you won’t find COBOL powering web sites, which makes the argument irrelevant to the topic. The last time I worked on a big legacy back-end I was putting a web front end on it, using PHP and ColdFusion.
- deleted 3y ago[deleted]
- ahoka 3y agoThe internet is full of spam sites made with Wordpress. This means nothing for PHP as a language.
- la_fayette 3y agoI like PHP, one issue which I face with PHP though is, that it is difficult to create a self-contained docker image. With node.js or java spring boot i can build an application with an http endpoint and create a single docker image with all included easily. With php I need 2 distinct containers, e.g., nginx, php-fpm and the code mounted on a volume to the the containers. So it seems to be more difficult for setup and continous integration etc. I would like to have one image with php, a webserver and the code. Is there something like that for PHP?
- monsieurbanana 3y agoYou can't have nginx and php in the same container?
- oaiey 3y agoDoes not docker recommend a single process story? Nginx is typically a reverse proxy in front of an application server.
- monsieurbanana 3y agoThat's just a generic recommendation though, really nothing stops you from having php and nginx in the same container.
- oaiey 3y agoWell, at least in the past you could have run apache with mod_php. And the php files should also integrateable into the image.
- xorcist 3y agoPHP has had a built-in web server since version 5. People use Apache or nginx because they want to, but because they need to.
- la_fayette 3y agoI think using the php built-in webserver is not an option for a production setting.
- seydor 3y agoThank god. Imagine if the whole internet was as fragile as the latest opinionated twitter rockstar programmer with VC's money
- throwmeout123 3y agoOf the brainwashed elixir zealots trying to convince everyone to use phoenix for a 3 users internal dashboard Fearless concurrency with actor model
- nologic01 3y agoPHP is a great web success story at so many levels. From massive sites like Wikipedia that have changed the world to the long tail of blogs and "Web 2" type decentralization. Anecdotally I see also rude health: Wordpress already has an activitypub plugin whereas symphony based kbin is a very interesting proposition for a federated alternative to reddit that already sees traction. And Nextcloud is delivering data sovereignty and showing the way for personalized "clouds" here and now. What is missing from PHP is really an easily communicable "story". Both at the technical level of the language and its tooling and at the community level and its vision. This is not unique to PHP. Older ecosystems like C++ and Java, on which much of the world still runs, have a similar problem. But the singular web focus of PHP means it has more of chance to develop an attractive personna. Its not easy but its very useful to have a very clear identity. Right now the tech world goes through an ML/AI fever (and associated nightmares) and a clear vision and purpose would, for example make it obvious how the PHP ecosystem fits into new developments and the broader client/server design.
- matt3210 3y agoLaravel really change the game for PHP!
- sschueller 3y agoI would argue Symfony did a lot as well. Their upgrade and release schedule is very good.
- eggsalada 3y ago[flagged]
- ctas 3y ago> Slack uses PHP for most of its server-side application logic […]. Slack migrated to Hacklang in 2016 [1]. [1] https://slack.engineering/hakana-taking-hack-seriously/ https://slack.engineering/hakana-taking-hack-seriously/ "We started migrating to a different language called Hack in 2016."
- Matl 3y agoIsn't Hack basically compiled PHP so that it is faster for FB's use case? I understand it's not technically PHP, but I imagine it is effectively still PHP, or is it more like what C++ is to C? I understand PHP is fast adding any actual language features that Hack has over it?
- phyrex 3y agoAt one point it was, but since then it’s become it’s own language with a completely new (JIT-based) implementation
- samsquire 3y agoThings I really like about PHP: Once the file is on the filesystem, it's deployed. Each invocation to run PHP is stateless and it parallelises effectively. (There's no communication, synchronization between PHP instances.)
- Capricorn2481 3y agoIt is definitely refreshing to simply upload a file via FTP and it updates your server. But it's this interpreted nature that makes PHP one of the slower languages in terms of throughout. I know, don't prematurely optimize, but there's a reason other languages don't do it this way
- fevangelou 3y agoAs the "Pitch Meeting" producer guy would say: PHP is tight!
- zyngaro 3y agoFrom php.net home page: « PHP 8.2 is a major update of the PHP language.It contains many new features, including readonly classes, null, false, and true as stand-alone types,… » That says all for me. Doesn’t matter if it powers half the web. It’s an awful programming language.
- smaps 3y agoCan you explain why you think it’s an awful language? It definitely used to be lacking in features, but the improvements in the recent versions have been great.
- zyngaro 3y agoDeveloper experience is awful. Variable names starting with $, heavy object orientism that seems like an after thought, tooling ecosystem is subpar, standard library is a joke, etc It’s a pile of crap and that’s my opinion
- dagw 3y agoI agree that the language itself has many warts and the standard library is what it is, but I found the modern PHP developer experience and tooling is surprisingly good. At least when working within the Laravel ecosystem.
- WA 3y agoWhat’s wrong with the standard library? Seems pretty extensive. Supports all kinds of DB drivers out of the box, JSON, XML, drawing tools…
- microdev 3y agoOne thing I really dislike about PHP is the global scope and imports. Introduction of namespaces is an improvement but it does not change the fact that everything is in global scope. The best practice for imports is to not include them outside of execution context, but it also makes it very hard to reason about what is actually being used by the file + you try to think about not loading files unnecessarily so it's not uncommon to add the import statement in the same file multiple times before using something and there are no type hints that say whether the include was imported or not. Which is more or less a consquence of the environment not having a proper runtime and everything being re-initialized with every request (in a runtime context, all files that would ever by used would be included, because they would be used eventually). I genuinely wonder how it came to be that a language developed specifically to serve web requests is not a loop, you would think that a runtime would be especially useful for handling requests and Facebook learned it the hard way, heck CLI input -> output programs are probably the only type of program where it would not be a limitation.
- okeuro49 3y agoI like PHP, because it has a familiar C-like syntax and great tooling, like composer, and frameworks, like Symfony. The language has warts, but it's improving. I think its strength is its architecture, namely shared-nothing state and concurrency at the web-request level. [1] [1] https://slack.engineering/taking-php-seriously/ https://slack.engineering/taking-php-seriously/
- jtjoadfs223 3y agoHHVM is evidence of the weakness of PHP and is a bandaid hack, but the article spins this as justification for PHP. What would you do if HHVM didn't even exist? Admittedly PHP has had recent performance gains, but by no means would it ever be a first choice in any backend service architecture.
- okeuro49 3y ago> What would you do if HHVM didn't even exist? If you're referring to the Slack article, it is a bit out of date. PHP has since added stronger typing and better performance. I don't think using HHVM is very popular.
- otterley 3y agoThis is a pretty silly take. It's like saying that performance improvements in the Java runtime and advanced garbage collectors like G1GC and ZGC are evidence of the weakness of Java. > Admittedly PHP has had recent performance gains, but by no means would it ever be a first choice in any backend service architecture. Other than at Yahoo, Facebook, ... Don't get me wrong; PHP has issues. But it's very mature; it's fast; it's easy to learn; it has a very diverse and rich ecosystem; it's easy to debug; and in general, it's very useful for building reasonably efficient and performant scalable web services.
- gregjor 3y agoYou either got hit by an avalanche of bad information or prefer to remain ignorant. What would any of us do if some innovation never happened? How does Facebook committing heavily to PHP and then giving back in the form of performance enhancements somehow tar PHP as crap? What language or framework with any longevity didn't have something like that happen? Is Javascript crap if not for Typescript, or V8? You may not make PHP your first choice but plenty of businesses and developers do. If you can point to some actual reasons no one should choose PHP, or widespread failures due solely to flaws in PHP, go ahead.
- innocenat 3y agoOne thing I absolutely love about PHP is the mod_intl which is almost always enabled everywhere. It provides ICU Transliterator and BreakIterator which is godsand to handle user-create content that's in Asian, Complex Script, etc. Last I check a few year ago Java is the only other platform with as good ICU integration, and nodejs has BreakIterator but not Transliterator. Other platform require complex setup to install ICU as a third party library.
- voidwtf 3y agoThis is great, and I'm glad for the PHP developers out there. But if I go job hunting, it's not PHP skills that offer the highest earning potential. At least not that I've encountered. How much revenue generation occurs on PHP? I'll cede the argument about the e-commerce platforms and CRMs, but I'm just not convinced that PHP is where a budding developer should be focusing their efforts. You enter the business/corporate world and there are tons of applications out there running the world, not just websites. Those applications are predominantly written in languages like .NET, Java, JS/ECMAScript, Python, Rust, and Go. Also, among the managed languages like .NET/Java/JS the knowledge is quite transferrable and sometimes almost identically named. I'm not trying to bash PHP as a language, but every time I see this argument it's the same. Evangelizing PHP also seems to come with a requirement to mention Wordpress, Wikipedia, and Facebook. I'm sure there's money to be made in PHP, and I'm sure it's a great language for the internet. But learning .NET or Java is likely to have a much larger window of opportunity. Also, if you have a specific industry you want to work in you should be looking at the language predominately sought after in that industry. I think this is why a lot of developers bash PHP, it's not that it's a non-valid choice. It's that it has limited applicability. I would never advise someone to learn PHP as their first language.
- gemstones 3y agoRight on the money. There’s a reason PHP shows so high on this list, and e-commerce is always mentioned. Analyses only have access to public sites, and PHP’s niche of blogs and e-commerce have lots of publicly crawl-able pages. The majority of sites may well be in something else, and the majority of things that people will pay you to code may be behind a login page.
- zmxz 3y agoI was job hunting this year, I'm a long-time PHP developer (since '99). It wasn't the language, it's everything around it. It's knowing frontend and how it works, it's knowing about cloud/operating systems, databases, 3rd party integration, IAM, SSO and the list goes on. These skills are applicable everywhere, next to any language. Compensation I was offered revolved around the ability to be non-invasive towards younger teammates and to provide education with emphasis on critical thinking. During the years I've done this job, I learned other languages as well and I can safely claim that initial language one learns has huge impact but it's learning additional skills that makes up for a valuable employee. In the end, knowing C# but not knowing PHP bears little insight into whether you're capable of listening about a requirement and coming up with a solution that satisfies the need, code it in such a way code can safely die one day and make in such a way that additional people in the team can jump in and manage it. I also found a lot of job offers and opportunities. My previous engagement was insurtech/fintech, there's quite a bit of PHP used there (and it works well). Wordpress, Magento, Facebook - these aren't the only places where PHP is/was used, the world we don't hear or read about is larger than the blogo-investo-googlesphere we're used to reading about.
- csomar 3y agoAs an ex-PHP developer (almost 10 years now), I do not miss it. As a language, it is a scripting language with an okay interpreter. But as an eco-system, it is a hot mess. It has both the worst software developers (and I was one of them) as well as the worst clients (and the cheapest, regardless of geography). It is not a surprise that PHP is running the web. That's because WordPress made sites/e-commerce accessible to the average Joe. Despite the massive security issues with these setups, it has enabled a large number of people to run businesses. But if you are a software developer, I'd strongly advice you not to do PHP.
- b112 3y agoModern PHP may as well be a new language. But then node came along. It's almost like PHP users couldn't stand a clean ecosystem.
- csomar 3y agoI don't think the language is the problem. As bad as it is, it is certainly more well thought that the original JavaScript. But PHP is used mostly by "businesses" with no budget and this is essentially the absolute rock-bottom of the "software" industry.
- acdha 3y agoI think the language is the problem in some key areas. I started using PHP at the tail end of 2.x and remember trying to get a couple of endemic sources of bugs fixed in 3.x: register globals, requiring constant diligence NOT to ignore errors, and inconsistencies around things like parameter ordering for array functions or magic type conversion. Every time, it got pushback from someone saying it’d break too much code – at a time when there were billions of lines less PHP in the world, and when those were causing high profile security issues and app failures. I ditched PHP in the 2000s after getting tired of that, but picked up a legacy project a couple of years ago. Register globals is finally gone but everything else which I remember causing having to carefully train developers to avoid in the 90s is still a rake in the grass today.
- 3y ago
- muglug 3y agoI’m quoted a bunch in this, which I appreciate, but there’s one mistake here — Slack no longer uses PHP, having migrated its codebase to Hack. Also listing language usage by what’s returned in server headers undercounts languages used on some of the biggest, most popular internet properties. Sites like Amazon, TikTok and YouTube/Google consume a lot of our total attention, but they tend not to report their backend server languages in response headers. If you shift from raw numbers to where people actually spend their time, I doubt PHP would be at the top.
- tacker2000 3y agoHack is a “dialect” of PHP created by Meta to be more performant and have types, among other features. So its not like they shifted their codebase to an entirely new language.
- 59nadir 3y agoIt certainly markets itself as a completely different language, though you'd probably expect that. On one hand I'm almost positive that someone who's made the transition from PHP to Hack would point out that it's way more cumbersome to switch than you're making it out to be but on the other I have no personal experience with it and I would assume that set is small enough where we might have issues finding one to inform us here.
- kristaps 3y ago77% of top 10M sites - sounds like reeling in the long tail for effect, has to be way lower for the top 1K sites.
- iambateman 3y agoFor those of you who are proponents of other web ecosystems, I’m curious what benefits you enjoy? What framework or language do you use and what makes it great? I use PHP everyday but we definitely have a lot to learn from others.
- JodieBenitez 3y agoStarting from 1997, over the years I completely replaced PHP with Python. Apart from the language itself, which I like a lot for many reasons, some benefits that come to my mind: - Better libraries and frameworks overall - Better programmers overall, so more competent colleagues - Relevant in many fields outside web development - Allows to learn and use various paradigms, like async/multithread/multiproc... I do keep track of PHP improvements. In fact, I keep a small personal toy framework as a way to test its new features. Some of these were very much welcomed, like safe mode + runtime typing. But some of these were just catch-ups and none of these are compelling enough so that I would want to start a new project in PHP. Other ecosystem I'm interested in is Go, for other reasons.
- JonathanBeuys 3y agoI expect Python to be more stable over the coming decades than PHP. PHP had a lot of breaking changes in the last version. Changes which got pushed through despite being quite controversial. I fear that this trend will continue. Python had breaking changes in version 3, but at least those made the language better. PHP's recent changes were unnecessary and counterproductive.
- JonathanBeuys 3y agoUnfortunately, the current maintainers of PHP have not learned from the success of it. And are driving PHP into the direction of having the rigid structure that Java has. It is so successful because people who build new things are different from people who are paid to maintain old things. That is why WordPress, Wikipedia and countless other successful internet projects have been created using PHP and not using Java. People who build new things like simplicity and elegance and tools that empower them. While people who are paid to maintain old things like a rigid structre which gives you the feeling of "nothing can go wrong". Also, people who build and run things do not like breaking changes of their stack. While people who are paid to maintain old things don't care about breaking changes in their stack. Because they are paid to then work around those changes. In the last version (8), PHP has introduced a ton of breaking changes which makes the language more rigid. And therefore less useful to build new things and more cumbersome to maintain: It broke the order of parameters in join statements. It broke calling static functions without the need to declare them as static. It broke adding properties dynamicly to objects. It broke easy string handling for many functions where null was rendered as an empty string. This is especially annoying as you often get null values from the database. It makes sens to have a value for "Don't know the color of the car" in the DB. And it makes sense to render it as "Color: " in the user interface. The easy string conversion always was one of the strengths of PHP. Why is it sabotaged now? Some of these changes have been objected to by the original developer of PHP and long standing contributors like the author of xdebeug, PHP's most popular debugger. Yet they have been implemented. The big danger is that this trend continues and existing PHP projects will be choked to death by more and more breaking changes. Changes which have to be worked around by making the code of the projects more and more bloated.
- deleted 3y ago[deleted]
- jw1224 3y agoPHP dev since 5.0 here. I think the severity of these breaking changes is overstated. I’ve been able to keep several large business-critical projects up-to-date for years, even up to PHP 8.3, with little to no breaking changes encountered. PHP 8 didn’t really break adding properties to objects dynamically, it just deprecated one bad-practice way of doing so. I remember worrying about this before upgrading, across my entire project with 40+ Composer direct dependencies, there were zero instances of this deprecated approach being used. With other breaking changes there’s plenty of notice given (years, even). You can control where and how deprecation notices are logged, there really shouldn’t be any surprises at upgrade time. “Old PHP” made it easy to write buggy or unpredictable code. Modern PHP feels more like writing TypeScript vs JS, there’s real safety and a much better developer experience now. PHP is having a resurgence for good reason, yes, it’s (marginally) harder to keep up with, but with proper tooling (PhpStorm, phpstan, etc.) the DX is leaps and bounds ahead of where it used to be. I thoroughly enjoy writing modern PHP. I don’t have to worry about the language doing unpredictable dynamic type casting unless I want it to explicitly. The flexibility of old PHP is still there, but it’s much harder to shoot yourself in the foot accidentally.
- NorwegianDude 3y agoIronically enough, if people actually tried PHP, many would be amazed, especially at the quality frameworks. Productivity is very high in something like Laravel, and compared to JavaScript frameworks PHP frameworks are much more feature complete and well though out. I'm a big fan of trying out different stacks, and I think a lot of people would love Laravel if they tried it. Give it a shot using PHPStorm and Laravel IDEA (free trials for both), and see what you think. Can't hurt.
- MrVandemar 3y agoWell, I used to do PHP back in the day, and I know the language has changed and evolved a lot, but I've looked at Laravel thinking it would be something cool and interesting and productive, and it seems bewildering and bloated. Doing one simple thing seems to take a mountain of incomprehensible overhead. Not to say it's bad, but even with some experience, I couldn't grok it.
- jw1224 3y ago> Doing one simple thing seems to take a mountain of incomprehensible overhead. If you just need to do one simple thing, don’t use a framework :) If you need to lots of simple (or complex) things, in an organised manner across a single project, Laravel is great! (Having said that if you have an example of what you were referring to, I’d be curious)
- hk1337 3y ago> Laravel IDEA Is that a fork of IntelliJ or did they just usurp the “IDEA” branding from JetBrains? A framework-centric IDE seems silly. Like mini cupcakes.
- uconnectlol 3y ago[flagged]
- oneplane 3y agoIt looks like a report on quantity of instances (sites, frameworks, packaged setups) but doesn't go into other metrics like traffic load, users, PnL or other money-metrics. Say the top 100 websites were all to use PHP, that would be a very different story than none of the top 100 websites using PHP, but neither is reported. We have some "we are in the top 500" and "we have billions of page views", but not much else. That said, how good or bad a language is might not be quantified or qualified to a point where all audiences are happy. How it's used vs how it's structured, where it's used vs. how much money it's making can all mean different things to different people. If you look at it from an academic (CS) perspective it might not matter how much money it makes if it lacks some scientific nuances. But the same works the other way around as well; it doesn't matter how cool COBOL, FORTRAN or lisp is if you can't run your massive eCommerce web app with it (there is a joke in here somewhere).
- synergy20 3y agoPHP was not great in the early days, same goes for Javascript, but they made web we use today, I'm not going to use today's standard on yesterday's realities. Both have moved on and are much better off now. Comparing to PHP, modern frontend is the true mess still though, there was never a simple to use SPA frontend in existence, they're all complicated, over-engineered and changing too fast to me, and now they are even adding what PHP was good at(SSR), frontend is the problem and getting even worse to me. The backend, be it PHP-laravel, Ruby-rails or python-django, even node-express are an already solved problem, the frontend framework folks adding SSR into frontend frameworks are simply insane to me. NOTE I'm not against SSR, what I dislike is that they add SSR directly into an already over-complicated SPA framework, which will kill itself under its own weight soon.
- skor 3y agophp is great to get things done quickly. great framework is cakephp, no one has mentioned it here yet
- rob 3y agoI'm in my 30s and grew up with PHP since the 2000s. There's still an insane amount of money to be made with WordPress plugins, WordPress support, and more. That industry isn't dead, it's thriving, it's insanely cheap to jump into and not get yourself into debt, and there's tons of people that need help. While people here argue about the 10th "correct" way to do server-side rendering (hey, React says we gotta use RSC now!) or figure out how to get their Rust code to compile to WASM for their Codepen demo website to increase a number from 1 to 2, thousands of us churn away daily making money from this "dinosaur" PHP in the real world. The bias on HN makes you think PHP is completely dead and it's funny to see the comments here.
- harlanji 3y agoI'd be more than happy to jump back to PHP and do some WordPress dev for as little as $15/hr. I feel like the problem is finding the first project to get some experience and sell the next project.
- gardenhedge 3y agowhere do you find work like this?
- ilrwbwrkhv 3y agoNot just that. I recently checked out Laracon, the Laravel conference. You can find videos on YouTube. But I am yet to find another programming conference that was this high energy, fun and focused on great developer experience. And because so many people make real money off of it, there is a focus on making practical things. Hackers who are looking at doing their own startup, might want to try out Laravel and it's ecosystem.
- mwinatschek 3y agoFor me PHP was the logical evolutional step between HTML and JavaScript. Those three components combined with CSS are all you need to create something great on the Internet.
- phendrenad2 3y agoRelated: I recently discovered the "fanlisting scene". In the early 2000s, some people started a trend of creating fan sites (a.k.a. shrines) for characters in TV shows, anime, games, etc. These sites ran on simple PHP codebases, such as Enthusiast, PHPFanBase, and BellaBuffs. Someone interviewed one of the developers here: https://hey.georgie.nu/hg-jem/ https://hey.georgie.nu/hg-jem/ (For some reason fanlistings tended to use .nu domains, because it was cool I guess). Most of these fanlistings (and also the massive number of forums running on vbulletin and phpbb in the early 2000s) were created not by software developers, but people who had a passion. It was a road that a lot of people, especially girls, took to get into software development. I think that gender parity in software development might have hit a record high during that time.
- gjvc 3y agoAs soon as WASM is able to draw to the canvas, we can stop using the DOM for anything and everything and pick up where we left off with GUI development in the 1990s.
- phendrenad2 3y agoDealing with text would still be a huge problem. Drawing text on canvas and making it selectable is still a hard problem, you have to think about all the intricacies of text (character widths, spacing, RTL, etc)
- gjvc 3y agoVery good point. This would require some standard library approach for much of this, which may or may not be feasible.
- thrusong 3y agoI love PHP and MySQL. I'm self taught and I've been writing it since 2007. It has helped me solve real problems at every job I've had since which has helped me advance my career in tremendous ways. I know PHP is not perfect and I've definitely contributed some hot messes of code in the past as I figured things out. Sorry... PHP has let me code anything I've wanted so far, so it's a really powerful tool for me. I'm the guy who built an automated home cinema using PHP and MySQL: I hit a button on a website and it tells a Raspberry Pi to start the desired show. It selects a Dolby ad, some sort of vintage ad like dancing hot dogs, a couple of trailers, and the feature. It brings the lights up for the credits. All PHP: https://www.youtube.com/watch?v=Q7YEVGWJjvI https://www.youtube.com/watch?v=Q7YEVGWJjvI
- cutler 3y agoSince PHP 5.3 why would you want to use PHP instead of Java when you're effectively writing Poor Man's Java but without the benefits of the JVM?
- throwmeout123 3y agoYou almost convinced me to try it again but then i remember about: * php.ini * php extensions * hardish deploy needing a specially configured web server * huge number of terribly named builtins * functions returning int|bool|null|whoknows * $, -> * cant trivially dockerize * laravel wants me to install even more crap other than Apache phpfpm php composer artisan sail larathis larathat so he can buy the second lambo by copying rails and django * xdebug And i just go on my merry way. Php devs forgot the mountain of quirk and bullshit they internalized. That’s the same reason I’m starting to hate python
- mwint 3y agoCan you add some color the bit about it not being trivially dockerized? Might be doing this soonish for work, would love extra info.
- throwmeout123 3y agoFor a Production setup we had to configure an nginx container plus the FPM container, let em talk, Configure some more Commands to enable/disable xdebug (that requires a restart of the containers since it needs a php estension) and i think that’s all. Other langs we use are literally “run the app” then kube will handle the rest.
- mwint 3y agoGot it, thanks!
- throwmeout123 3y agoYw, not really hard but since we’re not a php shop it required a lot of research, trial and error, complexity as in “need to know something not related to Application or domain” and ops are unhappy at having to support this one of a kind setup. There might be a better way tho
- husarcik 3y ago
- mediumsmart 3y agoI think 77% sounds about right. But I can’t decide if it’s 80 or 95 percent of those 77% that don’t need php in the first place.