
25 Years of PHP - brendt_gd
https://www.jetbrains.com/lp/php-25/
======
elric
I wrote _a lot_ of PHP from 1999-2008. First as a hobby, then professionally.
From 20 LOC guestbooks to payment gateways used to process millions in
payments. It wasn't until recently that I was sure I'd written more code in
any other language than PHP. These days I'll occasionally poke around with it
or patch a bug, but that's about it.

Is it a perfect language? No. But which language is? (I can hear the Lisp
crowd grumbling.) It's fast. The only ceremony you need to write executable
code is the <?php tag. It has a very rich standard library -- even if some of
the function names make me want to stab people.

My only real gripe with PHP is the annotation syntax. Yikes. Stuff that's in
comments _SHOULD NOT AFFECT RUNNING CODE_. Who came up with that?

PHP has taken a lot of flack over the years. Mostly from people who never
really worked with it. A lot of the criticism really should have been aimed at
certain PHP developers, rather than the language or the community at large.
PHP's low entry barrier is a blessing, it's how a lot of developers were
introduced to programming. It's also a curse, because a lot of very
inexperienced programmers managed to become prolific at getting code out
there, code which was ugly, bug infested and a security nightmare. But it's
not fair to attack a language over its inexperienced users.

~~~
ragnese
While I agree that PHP does have pros as well as cons, I find it disconcerting
that I've read MANY assertions here on HN, that PHP detractors just haven't
used it very much or are mostly complaining about things like bad standard
library function names.

I've used PHP in earnest. It and JavaScript are tied for worst programming
languages I've used. JavaScript gets more of a "pass" from me because I'm just
not a dynamic-typing fan and I'll admit that it might be less awful for
someone who enjoys/prefers Python or Ruby or whatever.

PHP, on the other hand, is basically just worse-Java. And Java isn't a great
language, either. The built-in PHP array is a constant source of frustration.
Keys are sometimes strings, sometimes ints. And you don't always know which it
is! This makes working with the array_* functions cumbersome at best. The fact
that you can't typehint everywhere also sucks. No generics sucks. No threads
sucks. No (real) async sucks. Globals suck (including different language
behavior based on a config file on your machine...........).

It's just not a strong language. And I'm super-tired of hearing "it's not the
tool, it's the user." There _is_ such a thing as a shitty tool. And just
because some human somewhere CAN write working code in Brainfuck, does NOT
mean that anybody SHOULD. I'm similarly tired of "all languages have warts".
Do I even need to actually explain the fallacy there?

On the other hand, I agree 100% that PHP's deployment story is awesome! But is
that because PHP did anything useful, or because Apache and Nginx support PHP
out of the box?

~~~
nobleach
Just like I tell people that buy cordless drills at Harbor Freight, "sometimes
it IS the tool". Does that mean you can't build fast, meaningful, cool things
with it? Of course you can. But, the deeper you get, the more problems you'll
have to solve with weird esoteric knowledge. I'll agree with all of your
points on horribly inconsistent and broken language features.

I get that people that have grown up with the language, or folks who have used
it full time for years, don't see these blemishes as that big of a deal. But
to newcomers, or folks from other languages, it's an affront. I hate to pile
on an old, worn out issue but, as a language designer/implementer, the moment
you start working on `mysql_real_escape_string()`, a huge warning bell should
have gone off! I'm fine if people want to question my competence in writing
code. It happens all the time on HN. I've been at it for 20 years... so some
rando telling me that I don't know what I'm doing is pretty common. What we
find in PHP though is quite a bit of tribal/tacit knowledge. And it's wrong to
blame the user.

~~~
spacedcowboy
I mean, who uses mysql_real_escape_string when you have PDO and bindings ?

PHP isn’t perfect. As OP said, no language is, and any competent software
engineer uses the parts of the language that work well for them, and just
ignores the things that don’t work for them. I don’t believe for a second that
the abuse the language has suffered over the years has anything to do with
mysql_real_escape_string, it’s more to do with crappy code. You can write
crappy code in any language, and it’s more a reflection of the programmer than
the programming language IMHO.

Part of PHP’s problem is that it’s so easy to use. Any C programmer can pick
up the basics pretty easily, hack together something that scratches an itch,
and move on. Later someone will criticize the quick hack and say “you didn’t
use mysql_real_escape_string so that code has a SQL vulnerability. Don’t use
PHP”. In reality, there are mechanisms for preventing SQL injection and they
just weren’t used. Is that a failing of the language ? Partly, perhaps, for
providing the unsafe way of doing things, but a lot of blame also lies with
the coder.

I’ll admit to a soft spot for PHP - I was putting database-driven websites on
the web when that wasn’t much of a thing (back in 1981, if foggy memory
recalls true). I wrote the asset management system that was used by Lucasfilm
on Star Wars, by Manix on the Matrix, by various post-production houses in
Soho, etc. etc. - all in PHP. We had video-streaming from remote locations
before RealNetworks were mainstream. All because of PHP.

I also used PHP to write a content management system for the RiskWaters Group
- around 100 magazines in the CMS, with forums, mailmerge, access-rights per
page or per view-count or per time-period, with back-end admin pages, with
macros the editors could use, etc. etc.

Used properly and judiciously, PHP is a powerful tool. It comes with a few
areas that ought to be marked ‘here be dragons’, but frankly so do most
languages.

These days, I mostly use PHP for shell-scripting (it comes installed as
standard on my Mac), nothing so grandiose as the halcyon days of yore, but I
still have PHP to thank for getting the job I’ve had for the last 15 years, in
R&D at Apple (“these are the guys that Lucas was talking about”, said the VP
who bought my small company).

I’ll finish with a line from a song “Baby, life’s what you make it, celebrate
it”. That applies to PHP as well.

~~~
nobleach
> I mean, who uses mysql_real_escape_string when you have PDO and bindings ?

You've made my point. A person with tribal knowledge probably would NOT. Any
new user coming from reading an older blog post or perhaps a PHP book would
have no idea that that "older approach" is out of date.

Furthermore, the more precise point I was trying to make there was as a
language designer, how on earth would you be okay implementing something like
that? (Remove my example of `mysql_read_escape_string()` and insert any of the
more WTF features of PHP.

Lastly, see my comment about being able to build meaningful, fast, cool things
with PHP. I never want to tear down anyone's hard work. (Rasmus/Zeev/etc
included).

~~~
lowercased
[https://dev.mysql.com/doc/refman/8.0/en/mysql-real-escape-
st...](https://dev.mysql.com/doc/refman/8.0/en/mysql-real-escape-string.html)

Many of the PHP extensions are direct exposure to underlying libraries. MySQL
introduced a 'real escape string' in their client library, PHP exposed that
directly. Had they ignored it, or renamed it, or changed param order, people
would have complained about that too, no?

> Any new user coming from reading an older blog post or perhaps a PHP book
> would have no idea that that "older approach" is out of date

You could mostly get that from going to the PHP doc site itself, which would
indicate things that are deprecated. Or your IDE might tell you.

Or, for things that are really out of date, like mysql_real_escape_string,
they simply ... aren't in the language any more, having been removed
completely from PHP7 several years ago. If someone is starting brand new today
using a blog post walking them through setting up PHP5... they'll have much
bigger problems.

There's a shitload of 'tribal knowledge' around stuff in many languages - you
find out a lot of that stuff via searching. If I read an 'older blog post' on
Go from 2015, and complained that my Go didn't work very well (or was
insecure, or whatever), how much blame should the language itself take?

~~~
14u2c
> Many of the PHP extensions are direct exposure to underlying libraries.
> MySQL introduced a 'real escape string' in their client library, PHP exposed
> that directly. Had they ignored it, or renamed it, or changed param order,
> people would have complained about that too, no?

Don't most ecosystems use some type of namespace for that instead of exposing
everything as global functions? Those practices were quite late to the PHP
community.

------
jonny383
PHP is damn fast now, no joke. And with all of the modern features it's
actually not so bad to work in.

I'm becoming increasingly puzzled every time I see PHP hate now, especially
when I read tired comments like "just use rails". Laravel is arguably as good
or even better than rails at this point, and PHP 7+ is definitely light years
faster and lighter.

One thing that still sucks is package management / composer.

~~~
joelbluminator
What are the "modern" features of php? It looks like it's trying to shed it's
dynamic nature and add types (with annotations etc). Also frameworks like
Symfony / Laravel look more and more like java web frameworks to me. I'm not
saying this is necessarily bad but there's nothing modern about types. Also,
might make more sense to choose java if you need types.

~~~
bouncycastle
The biggest advantages of PHP over Java are build and deploy times, so coding
a php app is much more rapid. You can test your app right away, even after a
single line change and get immediate feedback on the screen, which I think is
important in web dev because a lot of it is visual. The other advantage is the
run-time. Java has a slow startup time and when you redeploy then you need to
stop/start your entire app. With php you can fix / update one part of your app
without the need for a server restart. Another advantage is that php runs each
request with a clean state, that means all the variables get destroyed after
the request, helping to avoiding memory leaks, and possibly issues with
concurrency which Java exposes. Types are great, but sometimes they can get in
the way too and slow you down, (I still haven't figured out what those <funny>
types mean). In all, development in PHP is so much faster and easier over
Java.

~~~
jrimbault
> Another advantage is that php runs each request with a clean state

PHP apps are almost guaranteed to be "stateless", thus scaling up and down is
quasi-painless also.

~~~
bpizzi
OTOH, sometime you need state, then you feel stuck with a half-finished
language.

~~~
jakearmitage
What are you using state for in a web app or API?

~~~
bpizzi
Yeah sure, no need for state in a CRUD API. But while it is the most common
use case for PHP applications (well actually for application written in
scripting languages working with http servers), it's not the only use case.

When the only place where you can put state is the database then every piece
of state is written in the database. Which lead to intelligent individuals (no
pun/offense intended) to write clever piece of infra such as Redis. The truth
is, for 10 Redis deployment there's 7 (8? 6? Well, a _substantial part_ )
where a long living process holding little state would have done the trick.
Now you need to deploy, maintain and scale Redis too.

~~~
pak9rabid
What's wrong with using session variables for maintaining state?

~~~
watermelon0
Session variables are tied to user sessions (like name suggests), so they
cannot be used to persist application state (e.g. cached content, compiled
templates, metrics, etc.)

~~~
bpizzi
Exactly.

I see downvotes on my GP post, I'm simply stating the fact: if you need state
for a building a powerful webapp then obviously there's better runtimes that
PHP+Apache, I don't see how one could disagree with that statement, apart from
not having sufficient experience in that matter.

There's plenty of good reasons to counterbalance that fact thought, PHP has a
very good ecosystem, multiple mature/powerful web frameworks, and
cheap/abundant workforce. But it lacks a state holding runtime and for the
most demanding applications it's a sufficiently big technical hassle to
encourage seeking other runtime and/or language.

------
wiradikusuma
"Smarty released. The best-known templating engine for PHP.

Rasmus realized that he had done something wrong when people started writing
template engines for his template engine in his template engine"

:D

~~~
DonHopkins
I strongly agree Smarty is beyond terrible (and I've used it and read the
source code, so I know its problems first hand) and the fact that it even
exists is indicitive of deep flaws in PHP, but I don't believe Rasmus has ever
realized that he did anything wrong. He just doesn't care.

"We have things like protected properties. We have abstract methods. We have
all this stuff that your computer science teacher told you you should be
using. I DON'T CARE about this crap at all." -Rasmus Lerdorf

"I'm not a real programmer. I throw together things until it works then I move
on. The real programmers will say Yeah it works but you're leaking memory
everywhere. Perhaps we should fix that. I'll just restart Apache every 10
requests." -Rasmus Lerdorf

[https://news.ycombinator.com/item?id=20736574](https://news.ycombinator.com/item?id=20736574)

DonHopkins 9 months ago | parent | favorite | on: YAML: Probably not so great
after all

One of the most ridiculous examples of this was the Smarty templating language
for PHP. Somebody got the silly idea in their head of implementing a
templating language in PHP, even though PHP is ALREADY a templating language.
So they took out all the useful features of PHP, then stuck a few of them back
in with even goofier inconsistent hard-to-learn syntax, in a way that required
a code generation step, and made templates absolutely impossible to debug.

So in the end your template programmers need to know something just as
difficult as PHP itself, yet even more esoteric and less well documented, and
it doesn't even end up saving PHP programmers any time, either.

[https://web.archive.org/web/20100226023855/http://lutt.se/bl...](https://web.archive.org/web/20100226023855/http://lutt.se/blog/2006/08/13/why-
template-engines-like-smarty-sucks-in-php.html)

>Bad things you accomplish when using Smarty:

>Adding a second language to program in, and increasing the complexity. And
the language is not well spread at all, allthough it is’nt hard to learn.

>Not really making the code more readable for the designer.

>You include a lot of code which, in my eyes, is just overkill (more code to
parse means slower sites).

[https://web.archive.org/web/20090227001433/http://www.rantin...](https://web.archive.org/web/20090227001433/http://www.ranting-
wolf.info/2008/03/21/php-truth-about-short-open-tags-and-smarty/)

>Most people would argue, that Smarty is a good solution for templating. I
really can’t see any valid reasons, that that is so. Specially since
“Templating” and “Language” should never be in the same statement. Let alone
one word after another. People are telling me, that Smarty is “better for
designers, since they don’t need to learn PHP!”. Wait. What? You’re not
learning one programming language, but you’re learning some other? What’s the
point in that, anyway? Do us all a favour, and just think the next time you
issue that statement, okay?

[http://www.ianbicking.org/php-ghetto.html](http://www.ianbicking.org/php-
ghetto.html)

>I think the Broken Windows theory applies here. PHP is such a load of crap,
right down to the standard library, that it creates a culture where it's
acceptable to write horrible code. The bugs and security holes are so common,
it doesn't seem so important to keep everything in order and audited. Fixes
get applied wholesale, with monstrosities like magic quotes. It's like a
shoot-first-ask-questions-later policing policy -- sure some apps get messed
up, but maybe you catch a few attacks in the process. It's what happened when
the language designers gave up. Maybe with PHP 5 they are trying to clean up
the neighborhood, but that doesn't change the fact when you program in PHP you
are programming in a dump.

~~~
cutler
Why is the use of Blade(Laravel) or Twig(Symfony) any more acceptable than
Smarty?

~~~
coding_lobster
I personally like having the front end templates separated from the server
code as much as possible. I think Blade accomplishes this while also providing
you with a syntax that is much more readable than Smarty. On top of that I
feel like Blade isn't necessarily trying to do as much as Smarty.

EDIT: I certainly prefer using Blade to doing the old '<a href="' . $url .
'">... and other similar variants.

------
ChrisMarshallNY
I've written many languages (starting with ML –Machine Language).

I'm currently developing in Swift, and loving it.

I wrote PHP for about 20 of its 25 years. I never really got to love the
language, but got fairly good with it. I don't miss it much.

I have used it to write some industrial-scale systems, though. It's a
perfectly good language, and is still under active development and
improvement; with a vast user base and [m|b]illions of pages of support.

Even though a lot of us like to live on "the bleeding edge," I've found that
it's a good idea to stick with the classics for shipping code.

Nowadays, "the classics" includes JS and Python, so there are definitely good,
well-supported, mature alternatives to PHP.

I also programmed C++, and ran a C++ shop, for many years. I always find the
hate poured onto C++, with the annual "C++ is dead" pronouncement, quite
amusing.

But I really like Swift.

~~~
Cthulhu_
I enjoyed working with Swift, and I did enjoy working on Objective-C as well
back when; my main gripe with Swift is that it's still a niche language for
niche applications, unfortunately, and only really practical in a Mac
environment.

XCode is great though, I miss working with it. I miss the browser-like swipe-
to-go-back operation. I did set up a theme similar to Midnight in IntelliJ
though.

~~~
ChrisMarshallNY
Yes, but it is the prescribed language for native applications (like C#). Java
is really becoming a “niche” language for Android development (until it is
replaced with something like Go or Dart). We are seeing less and less of it
for server code, as Python and JS take over.

C++ is becoming “niche” for engine code. I’m glad it’s no longer really used
for UI.

There’s a lot of specialized languages popping out of the woodwork, these
days. I once worked with an image processing language called Halide, which I
found to be quite painful (it’s basically an FP language with the good parts
removed), but an interesting idea. Totally niche.

[https://halide-lang.org/](https://halide-lang.org/)

------
xd
Rasmus Lerdorf look at the last 25 years of PHP:
[https://www.youtube.com/watch?v=wCZ5TJCBWM](https://www.youtube.com/watch?v=wCZ5TJCBWM)

Really interesting for anyone wondering what the thinking was behind function
naming and other inconsistencies jump to:
[https://youtu.be/wCZ5TJCBWMg?t=987](https://youtu.be/wCZ5TJCBWMg?t=987) and
[https://youtu.be/wCZ5TJCBWMg?t=1466](https://youtu.be/wCZ5TJCBWMg?t=1466)

~~~
JAlexoid
If I look from outside - it looks like there was exactly 0 thinking involved
in function naming.

~~~
_-david-_
That is the look on the inside as well.

------
tzs
> PHP to have str_contains() A function that checks if a string is contained
> in another string? That should only take about 25 years.

For anyone else confused by the newest thing on the list who is wondering what
the heck str_contains() does that you could not already easily do with
strstr() or strpos() since time immemorial, the answer is nothing.

The only difference between str_contains($needle, $haystack) and
strstr($needle, $haystack) and strpos($needle, $haystack) is that after they
all make exactly the same C function call:

    
    
      php_memnstr(ZSTR_VAL(haystack), ZSTR_VAL(needle), ZSTR_LEN(needle), ZSTR_VAL(haystack) + ZSTR_LEN(haystack))
    

which returns either a pointer to the needle string in the haystack string or
NULL,

• str_contains() return false or true, depending on whether that pointer is
NULL or not,

• strstr() returns false or the part of haystack starting with needle,
depending on whether that pointer is NULL or not, and

• strpos() returns false or the offset of needle within haystack, depending on
whether that pointer is NULL or not.

It's equivalent to just writing (strpos(...) !== false) in your current code.

The rationale for adding str_compare() is that strstr() and strpos() are not
intuitive, easy to get wrong, or hard for new developers to remember.

~~~
Cthulhu_
I personally don't object to 'trivial' functions sprinkled in my stdlib. I
mean your own comment already highlights it, the return value of strstr() and
strpos() is not intuitive, whereas you expect a boolean for a 'contains()'
function.

Of course, it also highlights one of PHP's often repeated criticisms, that of
function naming inconsistency.

------
thdrdt
Most people don't know this and the timeline also doesn't make it very clear:
PHP never started as a language but as a templating system for C.

Feature requests were quickly added and that's why PHP became a language with
a lot of quirk's.

Today that is totally different. As a scripting language it is blazing fast.
It still has some strange corners, but it's amazing that a templating system
because such a wide used language.

------
olavgg
I started with PHP 15 years ago, but after 5 years I just moved to Java.

The worst thing with PHP was people and standards, everything was a mess,
there was no right way to do stuff and larger projects had like 100 different
implementations for the same thing. PHP was really challenging to work with as
coming to a shared agreement for how one should implement stuff was a recipe
for personal conflicts.

So after a few years, I just started to code web applications with Java. A
completely different, but much more enjoyable environment and much more
friendly people.

I guess PHP is much more fun today, it was really fun to code in PHP as it was
really simple and you feel productive and powerful. But in the old days, bad
defaults often caused issues in production. And some of the
documentation/knowledge sharing was dangerous(tutorials lacked warnings and
information about preventing SQL injections).

~~~
hanikesn
Symfony really paved the way for quality PHP code. Excellent Web framework
which is a lot of fun.

~~~
cutler
I could never buy a screen wide enough to display a full path with Symfony.
Not quite as bad as its predecessor - Zend Framework - but finding the end of
a file path was like jumping down a rabbit hole.

------
elpescado
Long time ago I was learning Perl, because at that time basically the whole
Internet ran on Perl CGI scripts. I thought, "man, Perl is weird".

Then I learnt PHP, because whole internet seemed to move to Apache+PHP. I
thought, "man, that's Perl done right!".

Then I actually learnt Perl, looked at my PHP code written earlier. I thought
"WTF?"

Now I use Python. I think "man, why I have to type this silly whitespace?"

~~~
tasuki
I can't wait to see what's next for you!

------
k__
I started my professional developer career with PHP 5.2 I think end of 2006.

While the langugage design was garbage, I the developer experience was quite
awesome.

This was a curse and a blessing. On the one hand it lowered the bar for many
people to get into programming, on the other hand it led many people to
believe they can do anything even when venturing in system designs that were
much above their pay grade.

I switched to JavaScript in 2011 and again, it was mostly for DX.

The language felt more light-weight (no $ or classes), while it still had
similar problems as PHP and being able to use it full stack eased context
switching rather much.

Node.js deployments felt much slimmer than setting up PHP with Apache/Nginx
too.

I still missed a bit of the "drop a source file in a folder and its an API"
feeling.

Last few weeks I played around with Cloudflare Workers and that got me a bit
of the PHP feeling again. I can simply say "This file runs at that path" and
be done with it.

------
bovermyer
After several years now of defaulting to Go, in the last month I've gone back
to PHP (specifically Laravel) for a new project.

It's... comfortable. That's probably the best way I can describe how I feel
about it. I've missed working in PHP, despite how much I enjoy Go.

~~~
zippoxer
Same. I love Go, the language, much more than PHP, but Laravel.. Laravel is
really great.

I wish Go had something as convenient and complete as Laravel. Unfortunately
that's impossible to achieve in a static language without polymorphism
(generics) or metaprogramming.

I'm waiting for Go to introduce polymorphism and I'll be watching closely to
see how 'post-generics' web frameworks make Go great again!

~~~
cutler
Have you tried the Buffalo framework? It's touted as Go's answer to Rails.

~~~
bovermyer
I've tried Buffalo. It's... fine, but it doesn't have the same feel as Laravel
does for PHP.

------
nickjj
While I don't use PHP today, it always makes me wonder at deceptively easy it
is to deploy a PHP app.

There's no having to worry about restarting processes since the next request
picks up the code changes and deploying at scale has so many problems auto-
solved by that such as rolling restarts.

You can then handle things like percent based feature roll outs at the
application level which is likely where it belongs anyways.

On the flip side, for single server deploys, you can also get by with zero
down deploys without needing to set anything up. Most other languages and
frameworks can't do this, or the way they do it involves doing very
complicated things or using even more complicated tools to solve the problem
for you.

It's funny to think back in the early 2000s I was using PHP and deploying was
brain dead simple then, but fast forward almost 20 years and it's still pretty
much the case today -- at least it seems that way based on the talks I've seen
around using PHP in production over the years.

~~~
closeparen
>There's no having to worry about restarting processes since the next request
picks up the code changes and deploying at scale has so many problems auto-
solved by that such as rolling restarts.

Nearly any serious PHP deployment will use an opcode cache which has to be
invalidated, though maybe they are smart enough to do that from the filesystem
now.

>On the flip side, for single server deploys, you can also get by with zero
down deploys without needing to set anything up

Mod_python works about the same as mod_php although you are right insofar as
most advice is to use a separate uWSGI process.

>You can then handle things like percent based feature roll outs at the
application level which is likely where it belongs anyways.

You want incremental rollout essentially every time you change code; if you
feature flagged every single change, you'd have your codebase's entire history
all hanging out on master, with far too many possible combinations of feature
flags to ever test. The nice thing about rolling back and forth with code is
that each version is internally coherent.

~~~
nickjj
> Nearly any serious PHP deployment will use an opcode cache which has to be
> invalidated, though maybe they are smart enough to do that from the
> filesystem now.

Etsy has a massive PHP deployment. In one of their talks they mentioned one of
the main perks of using PHP is they can just drop code onto a server and be
done with it. They are operating at pretty crazy scale. Even deploying to
hundreds of servers can happen very very quickly since you don't need to step
through a tiered rolling restart.

> You want incremental rollout essentially every time you change code; if you
> feature flagged every single change, you'd have your codebase's entire
> history all hanging out on master, with far too many possible combinations
> of feature flags to ever test.

Often times you want to restrict features or certain things based on business
logic in your app, not just a "dumb" load balancer. For example, you might
want to enable new things for specific users who opt into a beta program or
maybe only staff to start. But it could also be to a % of users. Usually the
idea is to feature flag bigger things and once it's rolled out fully you
remove the flag and now it's just something that exists all the time. Of
course this depends on your organization tho.

------
lux
It's so crazy to see how far the language has come, and how much it's matured!
I started working in Perl around '98-99, switched to PHP in 2000 just after
PHP 4 came out, and ended up running a company around it for all of my 20's.
Very thankful for the language and community that made that possible.

These days I still write a fair bit of PHP, but mainly C# and Go, and some
Javascript. I understand the criticisms of each language, but I don't mind the
type inference/coercion in scripting languages and don't find it actually
results in that many bugs. Although I do appreciate the clarity of choosing
your types and understanding their performance implications in C# and Go. I
guess it comes down to the right tool for the job, and some jobs do just fine
without strict types.

Since 7, PHP's also gotten fast enough that most web-related tasks are just
faster to solve with it, and it's so easy to deploy a Go binary alongside it
for performance-critical parts that it feels like a killer combo in terms of
productivity vs performance. Really itching to play with Roadrunner next,
which blends those two together into a single app server
([https://roadrunner.dev/](https://roadrunner.dev/)).

------
superasn
I've been working with PHP for a very long time and apart from web it is also
very good at writing shell scripts too.

One of my recent project called 'howdoi' (1) is written in less than 70 lines
of code (ignoring ws) - no libraries, no deps and backward comptabile to 5.0.
Just copy-paste the file and it's go! If you know how to use it, it's really
useful language.

(1)
[https://news.ycombinator.com/item?id=23230157](https://news.ycombinator.com/item?id=23230157)

~~~
ragnese
I'm really surprised that PHP hasn't picked up in this area. It's a great tool
when you're too big for bash, but not big enough for, well, a "more proper"
language...

~~~
superasn
Yeah an in-place file-editing feature like Perl or sed has would make it very
useful for command line use too.

------
OwnsE
Fine. After 20+ years of PHP development I'm going to give it a shot. Will be
attempting to migrate from VSCode. Any tips for that transition in particular,
or for setting up PHPStorm in general? I have a subscription to Laracasts and
plan on watching that series, but I'm not sure if it's outdated. Thanks!

~~~
jedieaston
There’s a fairly good plugin for JetBrains IDEs called “Key Promoter X” that
reminds you whenever you do an action (click build, open a terminal, change
directories) of the keyboard shortcut to do that same thing. It’s very handy
for getting into the workflow quickly.

~~~
WesleyJohnson
Thanks for this. I'm not necessarily aiming for mouse-free development, but
I've known for years that I could be better with keyboard shortcuts. I had no
idea this was a thing.

------
_def
I wish more digital subscription models were more like the jetbrains one. If
you paid for one year continously they handle it like you own that specific
phpstorm version, even if you cancel your subscription.

That said, I wish I could subscribe without having a company ._.

~~~
zeeZ
What do you mean? They do offer licenses for individuals, and I've had a
personal license for over seven years now.

~~~
agrippanux
He might be referring to the UX problem they have on the sales page where it
is non-intuitive that you have to click a button to switch to the individual
pricing. This affected me recently.

~~~
karatestomp
Holy shit I was just looking at their site the other day and bounced because
the price was way beyond anything I'd consider spending. It didn't occur to me
that they price differently for individuals, or that it'd default to showing
me organization pricing, and after reading theses posts and checking the site
my first guess was that individual pricing would be _higher_ (it's much lower
for some reason? Are the org. ones multi-seat? They don't seem to be. WTF.)

I'd never have even looked at their site again if I hadn't happened to read
these posts. Yikes. They need to call that out _much_ more vividly if they're
gonna have weird pricing like that.

~~~
lowercased
I think the org/business ones are 'seat' \- not named licenses. Devs may come
and go, but the org can have, say, 8 seats.

------
joosters
'This page is best viewed in landscape mode'

I don't think I'm going to rotate my desktop monitor just for your website :)

~~~
Intermernet
Your desktop monitor should already be in landscape mode, shouldn't it?

~~~
aloisdg
Not if you code a lot. It is not rare for developer to use vertical screen.
[https://img.devrant.com/devrant/rant/r_200135_Q9Fh4.jpg](https://img.devrant.com/devrant/rant/r_200135_Q9Fh4.jpg)

~~~
svrtknst
I mean I'd say it's pretty rare. I've only seen a handful of people do it
personally, and I've never seen anyone _exclusively_ use a portrait screen.

~~~
V-2
With modern monitors being as large as they are already, I'd say the need for
a vertical monitor is likely an indication you're working with spaghetti code.

~~~
richardwhiuk
With modern monitors being as large as they are already, I'd say the need for
a landscape monitor is likely an indication you are working in callback hell.

~~~
V-2
But it's not code all the way from side to side; I've got project structure
on, etc.

Meanwhile on the screenshot in the comment I responded to, the vertical
monitor is shown only to display a long script or program of sorts, nothing
else. I googled for the images of "vertical monitor programming", and the same
is true for virtually every picture of such setup. I feel it's not a
coincidence

------
jeffdavis
I have a theory that PHP is kind of like erlang -- as a framework and dev
environment, not the language itself.

Each request is pretty much independent of the others, and each one can
independently crash.

There was also CGI, but CGI always felt a little heavier, and the crashes were
harsher (usually just a 501 error and nothing more). PHP embraced the crashes
more and provided more information allowing faster debugging.

As a result, generally it was pretty easy to make resilient software.

Critically, PHP also embraced SQL databases, so that crashing meant aborting
the transaction (if any). Erlang never meshed quite as well with transactional
databases, so trying to keep consistent shared state in erlang felt tricky. In
PHP, it was natural.

~~~
BiteCode_dev
> Each request is pretty much independent of the others, and each one can
> independently crash.

Not the case anymore with phpfpm.

~~~
jbboehr
php-fpm uses a worker pool. How is this true unless you corrupt the shared
memory segment?

~~~
BiteCode_dev
I haven't checked it, but I think the worker stays up, and deal with several
requests during its life time, not just one then die. Hence, there is
pesistence.

~~~
jbboehr
As long as there is nothing broken in internals (a very big if, to be fair),
user code crashing will not affect subsequent requests.

------
atgreen
I first met Rasmus during my pre-internet BBS days in Toronto, and reached out
to him shortly after moving to the Bay Area in '95 when he told me about his
pet "Personal Home Page" project. What an amazing trajectory!

~~~
Minor49er
Very cool. How did you cross paths?

~~~
atgreen
He was just another dude on the Zooid BBS, which I dialed up on my 300 baud
modem.
[https://en.wikipedia.org/wiki/Zooid_BBS](https://en.wikipedia.org/wiki/Zooid_BBS)

------
geerlingguy
What ever happened to the PHP-FIG? I noticed in the timeline projects kept
dropping from it in the past 2 years. It seemed to have a lot of momentum for
a while producing PSRs that were very widely adopted.

~~~
swongel
Afaik after the whole PHPixie scandal, they got backlash but the PSR standards
they adopted are still in use.

PHPixie thread: [https://groups.google.com/forum/#!topic/php-
fig/cjLBp2weYaA](https://groups.google.com/forum/#!topic/php-fig/cjLBp2weYaA)

~~~
geerlingguy
Oh my. I lol’ed at the comment:

> A big +1 to what Robert said. Let's not be the PHP Drama Group or the PHP
> Court of Social Justice.

It seems like all these “groups that have arbitrary mechanisms for becoming a
member and have some sway in the wider community” eventually end up becoming a
giant ball of drama and controversy.

~~~
shockinglytrue
But doesn't that criteria also describe every open source mailing list ever?

------
fbn79
Anonymous function and callbacks in PHP are a mess (Have you ever heard of
Closure::fromCallable). Native function name and argument order are a mess
with no clear convention. This thinks alone have made me abandon the language
a couple of years ago. (I have two Zend PHP certifications and I was using PHP
since v.3). Now I'm very very happy with fullstack Javascript (plus occasional
TS help).

------
at_a_remove
It has been a long time since I have had to deal with Other People's PHP and I
have never had to with my own. Mostly, I have had to at least glance over
student projects that had security issues I could drive a bus through, honking
and dragging a bunch of rusty bikes.

In terms of language _design_ , I couldn't speak to it. I've never designed a
language and they are intensely personal things. However, I have the vague
sense that the _culture_ of PHP (installed by default, easy to get working)
created many fire-and-forget projects done to scratch an immediate itch with
no sense for maintenance. It works? Ship it.

You can write obfuscated code in any language, but some languages have a
culture which encourages it, such as Perl. Similarly, I think many perceptions
of PHP arose from a "make it work, now, anything else is someone else's
problem later" mindset I saw from the people who were developing in it.

I would be interested in other perspectives.

------
unexaminedlife
I think probably the most ironic thing about all the hate PHP gets, is that
those who hate it the most seem to assume that the people who chose to use it
did so without exploring other options.

So {your favorite language here} was turned down by a potential developer
because they saw PHP as the better option. People aren't stupid but from all
the rhetoric it seems the "geniuses" in the group think they are.

I wish I could request a POLL here. I'd ask, from all the people who hate PHP
and write extremely long posts about their hate for the language: How many of
you used some of that energy you expend hating PHP to write a patch or feature
for your favorite language to make it more desirable for other developers?

------
Keyframe
One thing I really enjoy in JS world is an ability to write both back and
front in same language. SPAs now being the norm also puts more weight towards
front. PHP had a knack for 'just works' in most cases and will always be dear
to my heart.

------
omnimus
PHP is still dominant in CMS space. If you are writing webapps use something
else. But if you are working on content then PHP CMS ecosystem is just way
ahead of everything else. You almost can't afford to go around it. And I dont
mean Wordpress. Modern CMSes like Craft, Kirby, Twill or even things like
Bolt, Processwire or Grav... they are pretty great mature platforms for custom
content websites and basic CRUD.

Hell with Wordpress (which i hate) and some plugins you get your own self
hosted website builder ala Squarespace. PrestaShop and OpenCart are solid
ecommerce solutions.

It's too dirty and DIY but it gets job done for most small to medium size
businesses.

------
hivacruz
What I love about PHP is its learning curve. You can quickly start making
things.

I started two decades ago with dirty PHP mixed with HTML pages, then I learned
templating. Then I learned OOP, classes, interfaces, abstract classes, traits,
managing dependencies and unit tests. All of these with PHP, no framework.

Because PHP is quite easy to use, I learned all these "general" principles
thanks to it. I guess nostalgia plays a big part in my appreciation of this
language but I will just say one thing: thank you PHP!

------
lbj
Amazing how many complete rewrites that timeline contains... :)

~~~
buboard
3

tbf i have a 12 year old php game that basically prints money - the only thing
i had to change was the old mysql module (which was not even buggy/unsafe -
just unmaintained).

~~~
atdt
What does it do?

~~~
dpacmittal
It says game

------
asadkn
And WordPress, which is hated even by PHP devs, continues to grow now powering
37.3% of all websites [1]. Until last year, it maintained compatibility with
PHP 5.2 essentially relying on PHP of the 2007 (now bumped to 5.6 which was
released in 2014).

[1]
[https://w3techs.com/technologies/overview/content_management](https://w3techs.com/technologies/overview/content_management)

------
hugozap
I believe PHP will still be relevant and a lot of the fancy frontend
frameworks out there won't be around anymore. Some kind of lindy effect in
place.

~~~
KerryJones
I first heard about the Lindy Effect from Nicholas Taleb -- for those who
don't know it:

The Lindy effect is a theory that the future life expectancy of some non-
perishable things like a technology or an idea is proportional to their
current age, so that every additional period of survival implies a longer
remaining life expectancy.

------
BilalBudhani
I taught myself PHP back in 2007 as it was the only language which had a
single click installer (WAMP) & easy tutorial to learn (w3schools) to get
started with programming. Since then I wrote a lot of PHP, initially for
myself then professionally once I got a good handle on it, until 2012.

Now I'm again thinking of picking up PHP for my side projects because of
Laravel.

------
dzonga
I'm not a php developer - syntax ain't for me. but props to these folks man.
25 years of getting shit done. shipping, amidst the jeers. I look at Laravel
as one of the big 3 web frameworks to use if you're serious about shipping
stuff. & in the PHP world, everything has been done - so you won't be doing
anything new.

------
0_gravitas
What I tell other people what it's been like working with PHP, it's usually
this:

"Working with PHP is like having a crazy guy with a gun on your side, by his
nature he is powerful and potent, and you can definitely get a lot of stuff
done with him... but who the hell gave this guy a gun?"

------
AndyMcConachie
There are only two kinds of programming languages. Those that everyone hates,
and those that no one uses.

Everyone hates PHP.

------
gotzmann
I kinda prefer PHP for most of my web backends like yet another REST API.

Modern framewrok like Comet easily beats any NodeJS or Python project
regarding performance and latency:

[https://github.com/gotzmann/comet](https://github.com/gotzmann/comet)

------
didip
I gotta say... PHP has grown so much and growing further in the right
direction (with union types and async I/O).

At the speed of its improvements... it's kind of embarrassing other dynamic
languages (I am looking at you Python, even though you are one of my
favorites).

------
durpleDrank
I've been using PHP for most of my web development career (a decade). What are
the industry standards for backend web development languages in 2020? I was
under the impression PHP was the way to go for back end web development.

~~~
roboyoshi
I would say golang has been a strong contender for that role for a while now
besides the usual java/ruby/python stacks. You can use many languages for your
backend, but golang is IMHO the best out there right now (but as always: it
really depends on your use-case)

~~~
historyremade
Hidden advertising for Go. Nothing better than good old C++.

------
whalesalad
> They [two startup founders] find PHP/FI 2.0 to be inefficient and lacking
> features. In 1997 they embark on a complete rewrite of the underlying
> interpreter.

Wild. Doing something like this today would be considered so tangential and
risky.

------
brian_herman__
"PHP is a minor evil perpetrated and created by incompetent amateurs, whereas
Perl is a great and insidious evil, perpetrated by skilled but perverted
professionals." -Jon Ribbens. Programmer.

------
p2detar
I’m thankful for PHP. I don’t use it on regular basis or even as my main
programming language, but I do use it for side gigs and smaller projects to
earn extra cash.

It’s fast, easy to get into and does the job for me.

------
rawoke083600
If it's THAT bad.. why is it still around and under active development 25
years on ?

Sure COBAL is also still around but the amount of new projects started in
COBAL vs PHP is a lot less.

~~~
BiteCode_dev
Because technologies don't win by being the best, or even by being good.

They just need to provide a killer feature and an easy path to adoption.

After that, inertia does the rest.

------
niyazpk
I haven't looked at PHP in ages. Now that I hear that the latest version are
much better, does anyone have links to good quality PHP code that I can take a
look at?

------
ra120271
Any pointers at SW that can build timelines in a similar way? I would like to
get product roadmaps out in a similar way if it can be kept light weight.

------
kingdomcome50
PHP as a _programming language_ is... okay. And it has come a long way in
recent years to become "okay". But frankly, wasting another keystroke
regurgitating to tired old "PHP sucks" trope would be to completely miss why
PHP is so great (hear me out).

PHP as a _development paradigm_ is second to none. The reason to choose PHP
isn't because it is such a great language, the reason to PHP is because it
gives you the most power for the least effort compared to any platform
targeting the web (fight me).

PHP is dead simple. I can make a new directory with a single index.php file
and view it in my browser in less than 10 seconds. I can then change/add more
files, hit F5, and _immediately_ see those changes reflected on my screen. It
is the tightest feedback loop possible. I didn't have to remember/rely on any
CLI helpers or package managers or debug tools. I didn't have to redeploy or
recompile or restart _anything_... none of the bullshit. Just _one_ file in
_one_ directory with _zero_ indirection. And we aren't even done yet!

PHP also gives you a built-in web framework out of the box. It _automatically_
parses server/request information and hands it to me for processing into a
response. What's that? I don't need a special templating engine to format my
output nicely either? PHP _is_ a templating engine! Did I mention routing is
also built-in (and transparent) as well?

The above is why PHP has become so popular/beloved by so many (and hated by
many more). Everyone complaining about the _language_ features ("array doesn't
work the way I want it to!") is simply putting their ignorance on full
display. There is nothing wrong with wanting something else out of your
development environment/paradigm (heck, I've moved on too!), but don't blame
PHP because it doesn't conform to _your_ idea of how an application should be
written.

The above is also why I am so disappointed by the direction the PHP community
seems to be taking the language. I am all for improving PHP as a language, but
to be honest, I have a feeling the maintainers are going to prove all of those
people that claim "PHP is just a worse Java" right... PHP will _never_ be as
powerful of a language as Java or C#, and for the reasons I explain above, it
_doesn 't matter_! Nobody is choosing PHP because of the language (if they
were, they would have chosen Java/C# in the first place).

If you want to improve PHP, improve upon the things that make it great. _Lean
in_ to templating. _Lean in_ to a more functional approach. _Lean in_ to
includes. Screw it, add some more magic! Make the _platform_ more ergonomic.
It was always the draw anyway. Who cares about the language...

------
gtm1260
As a new web dev who's never learned PHP, is it worth it? I don't really need
to write anything into production.

~~~
iimblack
As another newish web dev, I think it depends. Best thing is to take a look at
your local job market and see what people are using. In my area it's a lot of
.Net, so I'm focusing more on that. Some other areas have lots of PHP jobs,
others have Rails, etc. If you don't care about any of that, I still probably
wouldn't pick PHP honestly. I went with Go for my toy project backend, but
NodeJS is another good option I think.

------
racl101
May not be the prettiest language out there but it ALWAYS pays the bill.

------
elchin
If you were starting a project now, would you choose PHP or Hack?

~~~
ac42
Hack is interesting and the native C++ interface is a breeze. But choose PHP
if you want to live. Hack has only a fraction of the PHP ecosystem and if you
mix with PHP, then you lose the advantages very quickly.

------
spicyramen
Great language to prototype webpage and backend

------
jmnicolas
Once or twice a year I have to peak at the code of a PHP app that was
developed by interns more than 10 years ago. No framework was used, max 3
letters variables are the norm, no blank lines and the only comments are from
code copy pasted from examples.

These days I would be more inclined to celebrate the death of PHP than its
birthday !

However this app isn't GDPR compliant and I have good hope that it will be
gone in about a year.

~~~
willcipriano
> interns

> more than 10 years ago

How that looks to me: Wow, that application has provided so much business
value (over a decade worth) despite being designed by less experienced
software engineers. PHP must be a great language.

~~~
jmnicolas
It's non critical and isn't core to what we do. I don't have much time to
allocate to it.

My point is that all else being equal if it had been developed in Java or C#
my job would be much easier.

~~~
jiriknesl
Why haven't you refactored those 3-letter variables to more descriptive ones?

------
Mediterraneo10
Recently I have been thinking about moving my personal blog from Wordpress to
a static site generator, because I don't allow comments or use Wordpress
plugins. (Those who want comments can still use a combination of a static site
generator and Disqus.)

It occurred to me that once I did that, I could completely disable PHP on my
Apache installation. It made me wonder how much usage of PHP out there is
essentially a historical accident, and that if modern static site generators
had taken off before Movable Type, the language might have been much less
widely adopted.

~~~
innocenat
Depend on how you count what is static site generator.

Dreamweaver has a template system you can use to generate pages. It could
probably be considered a WYSIWYG static site generator. I have never used
FrontPage, but I would imagine similar system also exists. There are also a
lot of other WYSIWYG website editors out there during late 1990s and early
2000's.

Despite that, CMS system thrives.

~~~
slantyyz
On the "easier to use" front, there was also iWeb and apps like RapidWeaver.

------
coliveira
Many people here don't understand the genius of Php. The language thrives of
the ability to put out functionality that can be easily used by as many people
as possible, even if it is not polished or technically perfect. This raises
the ire of lots of programmers from "serious languages", which will usually
take years to figure out the best syntax, the perfect framework and tooling
environment, etc. While they're doing this, Php programmers are writing
billions of lines of code to support millions of websites all over the world.
Like many others, I sometimes hate the ugliness of what comes out from Php,
but there is no question that it works to get the job done without having to
learn the thousandth latest framework for language X.

