PHP is damn good in certain areas.<p>It is one of the best choices (if not the best choice) for rapid prototyping of a program. Its damn fast to similar alternatives (Python, Ruby, Dart, JavaScript), and the standard library is huge.<p>It does have footguns. I am not a fan of the loose typing, but you can take some steps to mitigate. You can do "===", "strict_types" and type hinting for function input and output. It is similar to C in that the language itself doesnt really do much to stop you from writing bad code. Also the function naming is not consistent, and even function arguments are not consistent. However PHP 8 will help with that somewhat, as you can now do named arguments.<p>Also PHP has the best language documentation I have ever seen. I would prefer more examples, but its well above some other languages.
PHP, since version 7.0, has been a much improved language since when many people started hating on it. They have been consistently moving the spec forward and making improvements. It's not perfect, but no language really is after all. It is really nice just seeing issues that have been around for a long time being addressed and fixed.
I think it is possible that PHP is still the best choice for web development in 2020.<p>I'm coming from an academic background and i was looking to learn a new backend language to create simple CRUD type, web applications. I already know c/c++, java, js and some python but after research it seems that Rails, Laravel and Django are the best options for this kind of projects as javascript on the backend is still a mess. So i've made a little comparison between them to choose what to learn.<p>Rails: It might be the best full stack web development framework from what i'm gathering, but it's declining fast and Ruby has a small market share outside the US.<p>Django: It's been always the 2nd or 3rd best option. Django 3.0 is going async which looks great on paper but in reality it needs work. It doesn't have a built-in asset pipeline for modern js development on the front-end. It needs plugins for basic stuff like social, api auth etc. Python has libraries for almost everything but the web is not always a first class citizen.<p>PHP: It is by far the most popular backend language. Libraries are tailored for web development and are probably well maintained because they are used by huge projects(wordpress, magento etc). For the same reason it won't disappear any time soon because it handles most of the information on the web and also billions of dollars in online commerce. Symfony has the most contributors than any backend framework and Laravel is probably the easiest framework to create an MVP with. Developers love Laravel and the community is huge. PHP is also improving and adopting new language features with a more advanced type system.<p>So the real question is why shouldn't someone learn PHP in 2020 ?
PHP is seeing a renascence and renewed interest similar to what happened with JavaScript a few decades ago.<p>A language that's easy to make fun of but widely used is an attractive target for improvement.
Article with an overview of the changes: <a href="https://stitcher.io/blog/new-in-php-8" rel="nofollow">https://stitcher.io/blog/new-in-php-8</a><p>Some highlights are union types, a JIT compiler, named arguments, annotations, and match expressions.<p>The approach to named arguments is interesting. It's nice that you don't have to change the signature of existing functions, but the downside seems to be that you can't enforce the usage of named arguments on callers, as in other languages like Ruby and Python where keyword arguments need to be declared as such.<p><pre><code> function foo(string $a, string $b, ?string $c = null, ?string $d = null)
{ /* … */ }
foo(
b: 'value b',
a: 'value a',
d: 'value d',
);</code></pre>
If the JIT for PHP ever becomes good enough it solves the memory leak problems PHP to this day is still plagued with, that might be enough to convince me to use PHP again, possibly, for some workloads.<p>I can't help but feel that PHPs popularity is mostly tied to Wordpress, and to a lesser extend Laravel (with Symfony coming in behind that).<p>Not really sure the rest of the ecosystem even matters, outside those core pieces. I'd love to see it fix alot of landstanding issues, and I love that the language has moved forward. I've worked with it professionally over the last few years in various places, and I don't particularly dislike so called "modern" PHP, but its only really good at very specified problem domains (mostly, you have a website, need to display said website. I always had scaling problems for anything other than using it in the context of a template language or very straightfoward database access. Real time APIs? nope. Just couldn't get it done, too much memory pressure)
Hopefully this will change Apple's mind.
<a href="https://twitter.com/GrahamJCampbell/status/1295111982924861442" rel="nofollow">https://twitter.com/GrahamJCampbell/status/12951119829248614...</a>
The best language is the one you can make money with or positively affect the world. Please grow up out of this old debate. You all sound like 3 year olds...
I heard about PHP is really just used by wordpress and drupal to keep its popularity ranking these days, and new projects seldom adopt it based on google trends, is this true?<p>The new PHP7/8 is certainly exciting, is it too late?