Part of a new series! Feel welcome to dip in and weigh in on a past question.
Let's say I've never used PHP before. Can anyone give the run down of what the language does and why you prefer it? Feel free to touch on drawbacks as well.
Part of a new series! Feel welcome to dip in and weigh in on a past question.
Let's say I've never used PHP before. Can anyone give the run down of what the language does and why you prefer it? Feel free to touch on drawbacks as well.
For further actions, you may consider blocking this person and/or reporting abuse
parthlaw -
dev.to staff -
dev.to staff -
dev.to staff -
Latest comments (74)
do not touch it.
In genera writing PHP is way shorter than writing Java or C# which are usually more verbose.
Some sources say over 75% of websites run on PHP.
Some sources say over 30% of websites use the WordPress framework, which is written in PHP.
Even visualstudio.microsoft.com/ is a WordPress site and therefore written in PHP. Way to go Microsoft!
PHP, in the its recent version, has become very riable. And it offers the flexibilty of a dynamic type language with the secureness of a strong type language. With PHP you can do, in a single line of code, what Java requires very more lines of code. Besides with the framework Laravel, if it used properly, you can do very ordinated and well organized projects. The problem is that with PHP you can easy break the rules of a well structured programming, so you could do a mess if you don't pay enough attention.
Pros:
Cons:
We all know PHP gets a lot of hate.
But it makes it really easy for a beginner to build a web project.
You might hear Junior Developers saying that PHP is slow, but they might forget that Facebook ran on PHP for a long time, and they're still using it in many components.
Wordpress uses PHP!
There is a lot of aggressive hate for PHP for all the wrong reasons (most all link to the same article written over a decade ago that mostly doesn't apply to PHP today, or things that apply to all interpreted languages equally)
Beyond that, I'll say this: PHP has the most enterprise friendly features of any of the major languages out there today.
Yeah, I'm going to get flack for this, but it from decades of experience maintaining systems that need 100% uptime.
PHP has the absolute most enterprise friendly MySQL connector outside of the C language itself, while still having the nicety of easy string manipulation. PHP has the most graceful support for distributed SQL databases with its connector, being able to handle database server failures better than any other language.
I'll admit, I'm kinda biased in this regards, however. As I'm the one that helped bake in some of that functionality. There are some extremely rare bugs in MySQL/MariaDB that can entirely hose an application server. I had one of these such bugs take out an entire fleet of application servers, getting them all in a locked state, essentially the DB DoSed the application servers.
Thanks to some of the additions I helped with to implement in PHP's connector, this is no longer an issue if the connector is configured properly. However, these same fixes don't exist in other languages like Python or JavaScript. DevOps generally just rely on "oh, it broke, let's reboot and hope it doesn't happen again" instead of doing the full investigation into the language's source code itself, the connector, and the database's source code.
Having done all that work, I know undoubtable that PHP can handle a fair bit number more failure scenarios than other languages, having done this at scale for 15+ years.
So yeah, if you're just starting out and have a single app server and a single database and rebooting them is fine, then maybe this isn't an issue. But if you're running thousands of servers at scale and need reliability and uptime, PHP's ability to horizontally scale easily mixed with its MySQL connector's ability to gracefully handle more situations makes it prime for very large workloads.
Its not obvious up-front, but PHP has more enterprise grade features than just about anything else out there.
PHP is a great language to use and works fantastically with frameworks like Laravel.
PHP is good for beginners and my favourite thing is that the name PHP is, itself, recursive.
Do you consider yourself a good engineer? Well, this is the chance to demonstrate it. Here's a language that has almost no rules, you can make real atrocities and yet make it work. The only thing that separates a horrendous, lovecraftean mess from an elegant and well engineered solution is YOU.
Do you know that "php" is pronouced same way backward ?
In addition to what has already been mentioned, this guy here levelsio makes $3.15M per year from a couple of SaaS projects, all written in PHP and often just a single
index.php
file. Pretty impresive for a language that "dOEsn'T sCAle".For PHP you can finde the best Job Board for PHP Jobs
Just the code running the board is NOT starting with <?php ;-)
You can have class, constant, function, method and property with the same name.