Idk about other languages, but PHP is not really compiled-compiled. It is technically compiled, but from a dev point of view, it is interpreted (and it fully supports JIT compilation since PHP8 anyway).
So you can really change stuff and see the results in real time.
Now, I don't think there's a particular PHP related culture around prod-debug, it is more about being around for a long time, and so you have a wide spectrum of shady devs working on it. I've met my share of "noir" developers, they are high functioning burnouts, and mess with prod code because they can't wait for their next cigarette break and they'll do anything to shut down their PMs high pitched voice. Anything to make it to the finish line: the bar at the end of the day. Then rince and repeat. Sign off the forms telling you take all the risks, relinquish QA processes, and just ssh some zips from your aging laptop so the man can make a few more bucks.
Ugh, I saw this first-hand in the most deranged way.
I was at an open source software conference, and there was a session on AngularJS, and I was like alright, sure, I'd like to know more about that. And if you're wondering what a client-side library has to do with nodejs, congrats you're already ahead of the instructor. But it got so much worse.
This dude had a one hour slot that was supposed to be a live coding workshop, and he spent 45 minutes of if trying to walk through the whole group through using a website that can run Linux in the browser to get Linux going, then set up a nodejs project with the Express framework to serve...the static pages with AngularJS stuff on them. Which there wasn't any time left to talk about.
He didn't. He was (ostensibly) teaching Angular. He didn't need any of that. I'm not 100% sure JSFiddle existed at the time, but it would have been perfect if it did. Otherwise, we could have just opened the html file from the filesystem, which is how things like that were taught in the old days.
I think he either wanted to show off that whole stack or was just so absorbed in that workflow he thought it was normal.
I see this a lot in enterprise video training courses. I'm trying to learn the deep magic of some new system, but first they're going to spend six hours explaining what virtual machines are, what the different hypervisor options are, how to install the one this course is using, installing the dependencies, like, bro, you could have made those out of scope and I'd have gotten a lot more value out of this. But no, you felt compelled to walk me through the whole damn thing as if I'd never seen a computer before, for some reason.
<?php
// Define a regular variable
$greeting = "hello";
// Create a variable variable using double dollar signs ($$)
$$greeting = "World!";
// $greeting holds "hello", so $$greeting creates $hello
echo $hello; // Outputs: World!
// You can also access it dynamically like this:
echo ${$greeting}; // Outputs: World!
?>
I remember feeling the need for this several times as a junior Java developer back in the day. Each time I found a proper way to solve the problem, but I guess in theory there could exist some obscure scenario where the only way to solve it is to use this method. But I have not seen it so far.
It's somewhat useful if you're creating a framework or similar to allow the devs using it to dynamically name their variables while using your framework functions.
I.e. Say they pass an array to a view using your function and now in my framework I want the array keys to work as variables inside the view
So passing $array = ["key"=>"value"] I can now access value using $key instead of $array["key"]
Because scripting. You can imagine $ as something like a Map.get(key) instead of assigning a name to some stack space. Instead of lowering a variable name to a pointer, as a compiler does, the interpreter has to dynamically find that variable name every time it’s referenced, so the name always exists, and more importantly, the code that maps that name to data always exists. A name just being a string, a variable holding a string allows nesting of lookups.
I so badly fucking hate how long the goddamn thing waffles before doing anything useful, every damn time. There’s gotta be a better way to do this shit then to just let it spin before it decides what to do.
364
u/ApatheistHeretic Oct 22 '26
Everyone has a test environment. Some companies choose to also run their production on it.
294
u/TheFrenchSavage Oct 22 '26
Patching in production is fun and I'm tired of pretending it isn't.
730
u/Alan-Foster Oct 22 '26
That PHP developer is so brave to not wear his furry costume in public
37
u/razor_train Oct 22 '26
Yup, on rare occasion I've done live PHP production patching back in the day.
41
u/IslayProgrammes Oct 22 '26
As a PHP developer… I’m too tired to be offended
63
u/OphidianSun Oct 22 '26
The only thing I know about PHP is that is supports variable variables which is both absolutely horrifying and deeply fascinating
16
u/Shadowlance23 Oct 22 '26
I feel personally attacked and I'm not even a PHP dev.
15
u/notexecutive Oct 23 '26
Why are devs of older languages trended towards this stereotype depiction?
3
u/aelfwine_widlast Oct 23 '26
Some people play chicken with cars, I play chicken with production code.
7
u/spartan117warrior Oct 22 '26
They tested in production at Sepang for the 2026 Bahrain (in Malaysia) Grand Prix.
20
u/LonelyPoorMan69 Oct 22 '26
PHP is not dead GUYS
4
u/ramdomvariableX Oct 22 '26
so what are you complaining about?
-39
u/Percolator2020 Oct 22 '26
PHP is for children and/or the depraved like Ron Jeremy.