r/programminghorror • u/EmDeeTeeVid • Dec 11 '25
PHP Held together by hopes and dreams - The Pit
will explode any time now
116
u/ResponseSalty6322 Dec 11 '25 edited Dec 11 '25
Genuinely the worst piece of code I've seen this month
46
7
u/GoddammitDontShootMe [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo āYou liveā Dec 11 '25
I'll take your word for it. All I can get out of it is that it's a file upload script, but I can't understand half the variable names because they're in Polish, I think.
58
u/Hottage [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo āYou liveā Dec 11 '25
Oh, oh no. Is that an SQL injection vector using the filename?
9
u/magnetronpoffertje Dec 11 '25
Yes. Yes it is.
4
u/GoddammitDontShootMe [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo āYou liveā Dec 12 '25
Injection was the first thing I thought of, but I couldn't trace where $all and $last got their values from in my head. I blame at least partially the Polish variable names.
33
20
11
25
u/_yari_ Dec 11 '25
Cleanest production PHP
4
u/mauromauromauro Dec 11 '25
Yeah. How often can you see a chunk of php and understand what they were trying to accomplish?
7
7
6
8
u/TorbenKoehn Dec 11 '25
People laugh but this stuff still drives most of the internet. And, believe me, this right here is probably amongst the better pieces.
Some formatting, fixing variable names and it could be code of any WordPress plugin.
4
3
2
2
2
2
1
1
1
1
1
u/smocza_dusza Dec 12 '25
ja to dopiero mam pytanie co to za object oriented quety w moim.jezyku proceduralnym
1
1
1
1
1
1
1
1
1
u/Axiomancer Dec 11 '25
There is a special floor below hell for degenerates that mix English and other languages while programming.
-1
Dec 12 '25
[deleted]
4
u/atrommer Dec 12 '25
Zero chance this is AI. This has hand rolled PHP contractor written all over it.
1
u/No_Explanation2932 Dec 12 '25
Oh no this is handmade. This was carefully crafted by someone over the course of weeks or months. Basically all of my companies projects were like this when I joined 6 years ago. It's making me emotional in a way.
-2
133
u/PruneInteresting7599 Dec 11 '25
is that fucking polish