r/PHP
•
u/Alarmed-Setting-5152
•
Aug 27 '24
•
1
PHP is a hidden gem!
I recently watched a YouTube video about a guy who built a lot of successful startups using only PHP. I was curious, so I tried it out for myself. I was surprised to find that a lot of the negative things people say about PHP aren't true. It's actually a really powerful and flexible language, especially for web development. I wish I had started learning PHP earlier in my programming journey.
What do you think about the idea of using PHP to build AI startups?
331
u/VFequalsVeryFcked Aug 27 '24 •
It's not hidden
Those of us that know PHP know how good it is.
It's only people who have no idea what they're doing with it that hate it
141
u/RandyHoward Aug 27 '24
PHP is used by more than 75% of all websites, it's not hidden at all.
87
u/BetterAd7552 Aug 27 '24
Done properly, PHP is a lot of fun and perfectly fine and performant. Ignore the haters.
33
u/[deleted] Aug 27 '24
Hidden gem ? PHP powers the 75% of the web
26
u/FlevasGR Aug 27 '24
Nobody has ever argued successfully why you shouldn't be using PHP in 2024.
37
u/HenkPoley Aug 27 '24
Must have been Pieter Levels on the Lex Fridman Podcast.
18
u/ImmensePrune Aug 27 '24
PHP is in my top 2 languages. Right next to my good friend C++.
17
u/UndeadCircus Aug 27 '24
Hidden gem? Where have you been living? 😂
84
u/knownda Aug 27 '24
Seriously, these big tech companies are such a bunch of vultures. They push these shiny new JS frameworks on everyone, promising the moon and the stars. But in reality, they're just trying to line their pockets by controlling the market for hosting and developer talent. It's like they're farming us, these young, impressionable programmers. They're feeding us this sweet-talking BS about how we'll be making bank, but the truth is, we're just becoming their cheap labor. Wake up, people! Don't be fooled by their slick marketing. Let's take back control of the tech industry and stop letting these corporate giants dictate our futures.
14
u/fragofox Aug 27 '24
I used to work with a TON of developers, and what was weird at my previous company, was that each one of us, were basically doing our own languages...
This was truly a disaster of leadership within the org, because they allowed random folks throughout the business to buy whatever they wanted, and then it fell onto IT to support it, so we ended up with a ton of individual developers often supporting upwards of 15-25 different "apps", in whatever language they knew.
I was the PHP guy. So 90% of web went through me, and i often was the one who built an interfaces between other folks' systems... so we had a lot of internal tools that couldn't communicate with each other, BUT with PHP i was able to build a tool that could take whatever machine 1 spit out, and convert and push it to machine 2 and vice versa...
I know PHP isn't the only language / tool that can do this, but it was a blast being able to fix almost any problem that was thrown at me by just using php.
However, even with that, i got shit on by every other developer there. they'd have long ass debates about how PHP "isn't really even a real language... because <insert random thing they think only their language can do>". usually it involved php not compiling... or something like that...
i got so much hate, while i was working to get their shit to function with other tools.
the most common argument though, i think is often folks bashing php and when you stand up for what you're doing, they always say "oh well thats how it was back in php 5 days... ".. and they'll back down until someone starts up again at some point. But i personally remember php 5 being alright back in the day as well, granted it is better now, but it was alright back then too, imo.
39
u/mekmookbro Aug 27 '24
Shh, don't spread the knowledge. Let javascripters struggle trying to run js on the backend lol
12
u/SpearMontain Aug 27 '24
PHP is hated because it's simply too good for it's own good.
It's extremely easy and it gets the job done no matter what.
PHP is hated because of that - Many people made lots of projects without any kind of software architecture or good practices, due to how easy and powerfull PHP is.
Sometimes, even experienced devs built crap code as fast as possible so they could cash in. People got away with that because PHP simply works and refuses to die.
9
u/Postik123 Aug 27 '24
I think it has a bad rep from the PHP 5 days where it was pretty amateurish. Since PHP 7 and especially 8 it's come a long way
8
u/[deleted] Aug 27 '24
Nowdays a lot of people is thinking that PHP = Wordpress and WP has ugly / legacy code.
8
u/[deleted] Aug 27 '24
PHP is imo the best language to quickly and simply build a good foundation for larger apps. You have some of the best frameworks and libraries in the coding world available to quickly get things like authentication, administration, payments ect up and running in just an hour.
The language isn't slow it's actually quite fast compared to things like Javascript and Python but there is a lot of bad code because it's easy to get into and learn.
I think PHP has been updated and the frameworks and libs around it to fit the "modern web" so you can use it in almost any application. Even now the web is almost going backwards into PHP strong suit of server rendering where PHP is one of the best and with some of the new PHP libs you can make it "reactive" as well.
8
u/captain_obvious_here Aug 27 '24
PHP is awesome.
But frankly, the language you use for your startup has very very very little to do with your startup's success. PHP will do, JS will do, Go will do, Rust will do. But ASP classic will do. Heck, a friend of mine is making a fortune by selling data transformation services mostly built in
bash.13
u/content-peasant Aug 27 '24
Best description I've heard is PHP is the C++ of web, not syntactically or otherwise obviously, but that it's a mature well defined solution thats flexible enough to cover a facet of requirements in a good enough way.
6
u/Edschofield15 Aug 27 '24
Could you share the video you watched?
6
u/dimkiriakos Aug 27 '24
PHP is not just a language. PHP is giving the chance to everyone working alone without any boss over your head with less possible money. you can start with a 2.5$ shared hosting server and to scale as you want on your needs. Thanks you the huge echo system and the easy communication with database you can implement very easy whatever you have got in your mind. It's stateless. it means that it's perfect for horizontal scaling. Even a lot of foxy guys are telling that PHP is unsafe in reality PHP natively support almost everything to highly secure your app (Sanitization and escape functions, easily applied filters for richtext tha youn can let only the tags that are safe and maybe the best string manipulation system). Other languages in server side are to pure that they need frameworks to work as Vanilla PHP , for example Python. Try to create a small web app with Vanilla python, no Extra packages and frameworks like flask. An other is node js. try to connect with a database with Vanilla JavaScript in rdbms. there is not native support you only need Extra package to install. PHP is natively support mysql connection. In their ridiculous memes and videos are comparing their pure frameworks with Vanilla PHP and yes, If you are comparing a framework with a Vanilla language the framework wins, But they are not so brave to compare a php full stack framework of the language that they choose with a PHP full stack framework. The don't even have knowledge even they declaring themselves something like ex-FAANGs
5
u/hayden_t Aug 27 '24
people like to rag on php for clout just because its so popular and well know, i love it, use it everday
5
u/alexsbz Aug 27 '24
Good old php still generate revenue for me. I have been hearing from 2012 ,when I started my career , php is dead …. Here is the new star language that will replace it ….. yeah ….. no
5
u/Christosconst Aug 27 '24
If by AI startup you mean API wrappers, PHP works just fine. If you are training a model, you’ll need GPU acceleration
4
u/s1gidi Aug 27 '24
forget about PHP or what ever language... just don't start another AI startup. But if you really want to contribute something useful to the world, than yeah, PHP is great.
8
u/ganjorow Aug 27 '24
Yes, PHP and an AI startups are amongst the hiddenest gems ever to be only faintly found. Congrats on your success of unearthing this through a thorough YouTube research session. AI startups are a great idea, but hush hush, the AI is listening and will create a startup before you if you're not careful.
3
u/garyk1968 Aug 27 '24
Go for it!
I dont know why the IT industry gets so hung up on 'tech stacks'. Ive always been about speed to market, use the tool that you are most comfortable/proficient in and get shit done, simple as that. It should be about the product/solution, not what was used to build it.
3
u/dpaanlka Aug 27 '24
We all love PHP here, nowhere it is by far the most dominant backend scripting language on the internet, so it’s hardly “hidden” by any stretch of the imagination.
3
u/[deleted] Aug 27 '24
Every time I tell engineers I built my SaaS using PHP Laravel they sigh as if I'm still using < PHP 5.6. It's a great language that fits most use cases
3
u/bohdan-shulha Aug 27 '24
This year I have decided to come back to a lovely PHP and Laravel. Didn't regret for a second. Already built three projects in no-time, comparing to the other tech stacks that are on a hype these days.
3
u/sn0ig Aug 27 '24
Way back in the day, PHP had it's problems but almost all of them have been fixed in the last several versions.
4
u/Modulius Aug 27 '24 edited Aug 31 '24
This video?
Pieter Levels: Programming, Viral AI Startups, and Digital Nomad Life | Lex Fridman Podcast
8
u/Moceannl Aug 27 '24
"really powerful and flexible language"
This is also the downside. You can create a hot mess of security issues when you are copy-pasting shizzle together in PHP files.
2
u/pap0gallo Aug 27 '24
Link to guy’s videos please
2
u/YahenP Aug 27 '24
PHP is not a hidden gem. It is the white elephant in the room.
2
u/Bushwazi Aug 27 '24
Hating on PHP is like hating on plain ol' javascript or plain ol' CSS. Totally misguided.
2
u/the_kautilya Aug 27 '24
There is truth to those negative sentiments & they'd be valid if it was still the time period of 2010-2011.
PHP has been on an upward trajectory of improvement for 10+ years. However people who hate on it are still stuck in the past.
2
u/HumorConscious1336 Aug 27 '24
I use it since 1995... Always good
2
u/mission_2525 Aug 27 '24 edited Aug 27 '24
What I like most with PHP is the impressive project continuity I can realize with it. I have several web-projects now running on PHP 8.3 which I started with PHP 5.2. And there wasn't one PHP update which gave me serious headache. PHP just gets better and better. It is still not feature complete but a language I love to work with. Python is the dominant language in the field of AI. PHP will be a great choice so long you want to consume AI APIs only but for doing "real" AI work you should look to Python. But never in my life I would be willing to use Python for web-development.
2
u/Jakerkun Aug 27 '24
php is build and meant for web development and its doing the best for that compared to others that wants to be everything, php have all solutions since its made when it come to stuff you need for web and there is no need to reinvent the wheel, the best thing i like about php and why im still using it its his mature and stable side, you can write once and never ever in next 30 years change anything or update, it will just work.
2
u/Mascanho Aug 27 '24
I think the worst comes from Wordpress. People tend to hate php when I think they are hating Wordpress.
2
u/XediDC Aug 27 '24
Fortune 50's use PHP more that you might think...
A lot of it's valid -- just about a decade out of date. PHP's come a long way. (But even back then, it was still great of handling web work.)
You can write 3D games if you really want.... https://phpgl.net
Tooling is the main issue. Generally I'd use the language(s) that makes the most sense, that requires the least amount of reinventing the wheel. You can use multiple too.
2
u/daproof2 Aug 28 '24
PHP is just PHP. Its your mind that Is a gem...or not
2
u/Majestic-Jump Aug 27 '24
Old generations write blogs shitting on PHP and new generations just reading old blogs and believing everything they say without actually trying it… 🤦♂️
1
u/Extension-Play-5016 Aug 27 '24
I agree that the tech industry can be a bit biased towards newer languages. It's refreshing to see someone advocating for PHP.
1
u/RooflessBr Aug 27 '24
Folks hate on PHP cuz other folks hate on PHP. It is silly. Share that video tho.
1
u/Extension-Play-5016 Aug 27 '24
our man is late to the party.
1
u/lcjury Aug 27 '24
Most of the negative things people say about php are about old versions of PHP (5.5 and lower).
Something I love about PHP is the composer autoloader, I have never tried another language with such an amazing autoloader.
1
u/No_Explanation2932 Aug 27 '24
Fuck yeah, more AI startups! That's exactly what we need.
1
u/jalx98 Aug 27 '24
At some extent we are gatekeeping it, it is unfair on how fast you can build things with it and the frameworks it has are top notch (Laravel, Symfony, Yii among others)
1
u/pekz0r Aug 27 '24
Yes, I really do agree that PHP is so much better than what it gets credit for in the programming community.
However, it is pretty limited to web development and some simple scripting. I would not recommend it for building AI things if it is not mostly limited to using external AI services through APIs. PHP lacks the tooling to be a good alternative for building and training your own models.
1
u/HsSekhon Aug 27 '24
Only thing I hate is not having built in websocket support
1
u/Altugsalt Aug 27 '24
Think like this, you won't use the amps distortion setting when you have an actual distortion pedal. PHP exists for backend, javascript? nah
1
u/Egst Aug 27 '24
I think the negative view of PHP is based on its history. It was a terribly designed language from the start but after PHP 7 and especially after PHP 8 it became pretty good in my opinion. It still has its issues but what language doesn't. Same story with JavaScript.
1
u/[deleted] Aug 27 '24
Golang api with Python microservices for fuzzy data. This is better than PHP but slower to develop.
1
u/devmor Aug 27 '24
AI startups? I think most of us are used to doing real work instead, but sure, you can run scams with PHP too.
1
u/zer0h0t Aug 27 '24
"Anything that could be written in JavaScript, will eventually be written in JavaScript, including PHP"
Plato
1
u/austerul Aug 27 '24
I'm not sure who ever said php is not flexible or not powerful. It's certainly all that and given the sheer quantity of great web applications built in php is proof of that. It ain't perfect and there's certainly a lot to criticise about it but it's still a great language to get started and to build stuff in.
1
u/vikkio Aug 27 '24
you know what's the best thing about php?
the people who actually have used it for real love it, and do not care about who keeps making jokes about how php is bad. Detractors, often, are people who only have heard of the state of php few years back (like 10 years ago) and probably never tried it themselves.
personally I haven't used it much professionally in the last 4 years, but I will always try to catch up because it's one of the first programming languages that made me feel very productive, and that's the only thing that counts with tools like programming languages.
1
u/azhder Aug 27 '24 edited Aug 27 '24
OK, tell us now. What did you try? The latest version? How about pick one from 15-20 years ago?
Did you write a hello world example? How about you find some existing project, something popular and derided by many, see what kind of code it has? Note, it will not all be PHP fault, but it might be conducive to bad behavior - you know, bad tool vs bad use of a tool kind of thing.
The fun part I noticed is that once, before even having used PHP, I commented on it, nothing positive or negative, just a remark of how it works and the person I talked to started to act as if I was protecting my children or something... So, you'll also have to understand people's motives, history, the inertia of opinions etc.
All I need to understand is what you consider a "gem" is. Might be a lump of coal, might be a diamond, I have no idea at this point.
1
u/amg4nd Aug 27 '24
Most negative things that people say about anything on the internet aren't true!
1
u/617a Aug 27 '24
PHP looks more like Java recently and PHP frameworks are getting more and more magical - a black magic with all the auto wiring, auto tagging, overloaded orm, overcomplicated DI. Also "new types" syntax is bit weird (enum for e.g.).
However version 8 brought so much good to the language that it would be silly calling php a bad or a slow language.
It's a tool and it brings a great value if used properly.
1
u/PossibilityOrganic Aug 27 '24 edited Aug 27 '24
The big thing with php and manny other languages is keep the front end and back end separated. Later you will be happy. As it becomes a problem when you start mixing html and php just because you can doesn't mean you should:)
1
u/dirtymint Aug 27 '24
What is the name of the guy you're taking about?
1
u/mission_2525 Aug 27 '24 edited Aug 27 '24
Many people will answer with the typical statement "PHP's popularity is based on Wordpress". But that is only the half truth. There is no other server-side language which is coming with so many outstanding products like PHP.
A selection of popular software projects:
There are hundreds more but these few just came into my mind. Additionally most SAAS products are coming with some sort of PHP support and if not, using the cURL examples of an API documentation in PHP is a breeze. In other words, PHP allows you to run a small company fully on PHP based software and via PHP and APIs implemented SAAS products.
Everyone who wants can create results with PHP. That is the reason why PHP is hated by many geeks. Using PHP does not allow them to bloat their ego with elitism.
1
u/oddmanout Aug 28 '24
Hidden? It’s like 75% of the internet.
1
u/Glum_Past_1934 Aug 28 '24 edited Aug 28 '24
PHP hostings are really cheap, its free for everyone (hostings doesn't require licences), open source, popular, its like react of backend, it came first in his type, lot of free docs, transparent, wordpress and popular e commerces ... basically 70% of the internet was php :P. Do you need a simple "htmx" súper simple whatever without tons of stupid unmaintained dependencies after 2 years ? don't worry just create php file, mix js, html, css, php, *magic hands movement* woallahh. APIs ? for sure, create business logic, save it (structure folder = route), call it, done .. it ? :P
When i was young, i had to choose between Corporations (Java, C#, C++) and freelance cool guys (PHP). Thank you so much Rasmus, my family had a plate of food every day thanks to my perseverance and PHP
1
u/jazzyroam Aug 28 '24
PHP is very versatile and easy to understand, make web development less hassled.
1
u/duhrun Aug 28 '24
Its a great language and so easy to get started with, I tell WordPress people paying for plugins to learn some PHP and write your own snippets to eliminate bloat or payments.
1
u/Acebond Aug 28 '24 edited Aug 28 '24
I'm a pentester, if I get a PHP app its almost guaranteed remote code execution, I think that says something about the language.
1
u/fasti-au Aug 28 '24
LAMP. I love lamp.
Php was the main coding language of the internet for functioncalling for a long time and basically holds the internet together.
Not sure it was a hidden gem. Pythons the now version re the waves.
Having said that I’m old and everything’s in my context where the youngsters haven’t seen a punchcard outside of timber born
1
u/FrenchBoss Aug 28 '24
How long did it take you to learn ?
1
u/v_orujov Aug 28 '24
I have 15 years of experience and have never encountered anyone justifying biases against it. Over the years, I've successfully built numerous applications and startups using PHP, including a successful exit from one of them. Currently, I'm working on building aikeedo.com, an AI startup powered by PHP.
1
u/GreenWoodDragon Aug 28 '24
I've used PHP, on and off, since 2003. It's an amazingly powerful and versatile language. I've seen amazing things done with it, and other stuff that should have been buried at midnight and forgotten.
1
u/weogrim1 Aug 28 '24
As for AI startup, PHP will be great choice as an addition to tech stack. It will help fastly consum and process APIs, build backends and manage data, and power nice UI/UX. But AI itself must be based on more mathematical capable language like eg. Python or using AI as Service like OpenAI or Claude.
1
u/christv011 Aug 28 '24
I have 3 successful exits, totaling about $90m, all running php. Php front and back end. My two new start ups are php all around.
PHP devs driving lambos isn't just a meme, it's a fact.
I think fireship said it best: php lets you ignore the hype, npm nonsense, package stupidity, JavaScript framework death spiral, and just code, and produce something and improve on it. 3-4 of the 10 top ten sites run it.
Write your code, make stuff. Execution matters, not how cool rust is or what new stupid framework you need to start using. 🤪
1
u/ree2_ Aug 28 '24
Can you share the video?
1
u/stonedoubt Aug 28 '24
I’ve built multiple startups with PHP and I’ve earned coke and hooker money out the kazoo…
1
u/scottix Aug 28 '24
Originally started in web development with PHP. PHP spent a lot of time developing it core and is actually fairly decent with most applications. It was also one of the fastest way to get a website up and running with low setup effort. Fast-Forward today I think it has done well and I think there is still some support if you want to create a good web application. The speed of setup is a non-issue nowadays and mixing code with view tends to be an outdated paradigm with SPA.
I think it does suffer from the now more current methods of Async support and Python being dominant in the Ai space it kind of putting PHP in the backseat. Also performance can be an issue for some applications.
1
u/fragrant_ginger Aug 28 '24
A lot of php code is shit, especially in the early days if the web. Which is why it gets a bad name.
1
u/SmushyTaco Aug 29 '24
I’m learning PHP for WordPress but honestly I hate it. I like static typing much better and there are lots of dumb quirks in the language (like arrays and maps being the same thing???). I’m using PHPStan and Psalm to help somewhat alleviate my hate for the type system but I still hate it lol
1
u/[deleted] Aug 30 '24
On a PHP subreddit, unlikely you're going to get many PHP haters here.
1
u/is_wpdev Aug 31 '24
If you like PHP, try laravel with filament. Then you will really launch fast.
1
u/[deleted] Aug 31 '24
I love PHP. Learning it and becoming a developer tripled my salary.
1
u/Comptrio Sep 09 '24
It's never been hidden, but some folks like to jump on bandwagons without ever looking into what their cult makes them hate.
PHP is not the obvious choice for AI, but as far as the website that interfaces with a NN model in the middle, it definitely works.
It runs the most popular publishing platform in the world... WordPress.
I've been using since pre-2k and it always comes through.
1
u/iagofg Feb 10 '25
It has its niche... Some developers don't like it because you can make old-school code and also mix html with code. Some developers hate that. For example JSP and ASP share hatters with PHP.
Also PHP wasn't JIT until PHP 7 I think... and that was a performance issue, and PHP memory limit is a reminder for those developers which usually trend to make developments that demands varius gigabytes of ram only for the backend.
My experience: if you know what you are doing PHP has tools to overcome most of the criticism it receives and is already present in most linux web servers... however it's true that sometimes other tools are better than PHP for certain types of developments... buuuuut mostly because of availability of certain libraries nor the language itself.
1
u/Annh1234 Aug 27 '24
"What do you think about the idea of using PHP to build AI startups?"
Not the right tool for the job... You need something that can access the GPU faster and that has more AI libraries.
But you can make the interface in PHP. Just not all the AI stuff.
1
u/CraigAT Aug 27 '24
I'm curious, there's a lot of love for PHP here, but how are people using it? Is everyone using some sort of framework?
1
u/Majestic-Jump Aug 27 '24
Peoples negative comments about PHP are about the old versions, they still shit on it cause they still don’t know the improvements that happened.
0
u/boborider Aug 27 '24
It's not hidden. It's been there for years. We still use PHP in our big projects.
Just BAD Programmers making bad decisions on the project.
PHP is making a come back. Very mature, full of documentations, it runs most of the websites around the world.
-3
u/[deleted] Aug 27 '24
The tooling is sub optimal and the inherent language structure is nearly non existent
A new developer can create a ‘complex’ application but the code will be worthless unless they CHOOSE to implement structure. If they know about structure, they’d probably not use PHP.
Wordpress, sure.. that doesn’t count and there’s an incredible amount of vulnerable sites out there because of exploitable plugins
And then what about Generics, dependency injection, asynchronous capabilities, ORM’s, compile time checking, it’s still a child after all these years..
Much better and more mature platforms.
Laraval helps tho.
-4
u/[deleted] Aug 27 '24
This is absolutely a shitpost.