So DNA Lounge has an online store, which is an enormous, and ancient, and shitty, pile of PHP code. I have often characterized it as "it's a pile of shit, but it's our pile of shit."
Well, now that I'm opening a new nightclub, I need to make that code be able to function when installed on a domain whose name is not "dnalounge.com". As you can expect, this has been a process of discovering all kinds of hardcoded assumptions lurking in the bowels. It's like moving to a new house after you've been dug in for a decade: look at all this crap stuffed in the back of the closet that you didn't remember was there!
So there has been a lot of global search and replace, and a lot of variables being added and moved around, and that means destabilization, and that's bad, mmkay?
So I wrote a Perl program to do static analysis of PHP. And it parses PHP using regular expressions because fuck you that's why.
For your entertainment -- because I sincerely doubt that anyone who is not me will ever use this without lulz in their heart -- I give you jwz-php-lint.pl.
And now you have three problems?
Here's my entry in your Codeword logo contest:
0 setgray clippath fill showpage
That's right: The logo is a PostScript program that prints a black page! Not a black page itself -- that's just the effect of executing the logo, and would probably violate somebody else's copyright. I'll be looking forward to my black t-shirt with the logo printed in white, please.
I love PHP. It's so bad.
PHP is truly an argument in the "good programmers can write good code in any language" debate.
On a more serious note, the variable tainting would be an awesome feature.
It's also an argument in the "bad tools make pinheads of us all" debate.
PHP's tokenizer is available to the developer. I am not a PHP fan (I decamped to nodejs years ago) but this is a decent feature:
There's also PHP-Parser (https://github.com/nikic/PHP-Parser) if you want a full syntax tree.
I like the fact that most jwz performance art involves Perl.
Alternative title: "I'm opening a new nightclub, [...so] I wrote a Perl program to do static analysis of PHP."
When you put it like that, you make it sound like I'm a bad decision-maker in at least two ways.
Could be worse. Could have been "I'm opening a new nightclub, [...so] I wrote a PHP program to do static analysis of PHP."
Honestly though, the true hell is working with WordPress. Especially trying to shoehorn in things it wasn't meant to do. That was what made me glad to be a mere retail slave, instead of a full time web dev.
people still write perl? ;)
People still make that joke? ;)
I don't think you can get pleurisy that way. You probably have lupus. Better call Dr. House.
This reminded me of the language Idris, which added a PHP backend, sort-of.
Prefixed with "Please, don't ever use this.".
My favorite PHP rant ever is titled PHP: a fractal of bad design. That covers it, really (and, yes, I totally understand why your working crap software is superior to some theoretically better software that isn't currently in place).
Yes, I've read that and it's brilliant! But the best part is that someone actually made the double-claw PHP hammer: