News for hackers. Stuff that matters.
Re:Every C99.php shell is backdoored by kabdib on Tuesday June 24, 2014 @07:24AM (#7937099)
... and to think that my contempt for PHP couldn't be increased.

Wow. This is the anti-Scheme. It's like they took everything good in language design and decided to do the exact opposite. "Let's make a function that has the side effect of introducing variables into scope. That's a great idea."

Oh, Bog....

Re:Every C99.php shell is backdoored by ars on Tuesday June 24, 2014 @02:19PM (#7939408)
> This is the anti-Scheme.

Since when is Scheme the arbiter of what is good or bad?

PHP lets you do this, or not do this, your choice. Like C, PHP doesn't tell you what to do, it's up to you.

That's why people actually use it.

Re:Every C99.php shell is backdoored by kabdib on Sunday June 29, 2014 @10:25AM (#7961247)
Just because something is being used widely does not make it right, nor should it be held up as a fine example of design.

Language hacks like the one we're discussing are fine IF:

- You work with people who avoid bad features.

- You can avoid using code that uses bad features (less of a problem, until you have to debug things and then you're in a world of hurt).

- The features are not short-sighted hacks that prevent the language from moving forward (e.g., eliminate the opportunity to make things faster through dynamic compilation or whatever).

Scheme is a great language that is not useful in the real world, while PHP is a terrible language that happens to be in wide use. Neither of these positions are unique, and honestly I'd much rather use a bad language with good tooling than a great language with poor support. But I will continue to point out PHP's flaws, which are many and just howling bad, and work towards improving the alternatives.

Re:Every C99.php shell is backdoored by fleitz on Tuesday June 24, 2014 @03:40PM (#7940045)
Exactly, what's wrong with a double clawed hammer?

Use it or not, if you don't like it you can smash stuff with the triblade screw driver. Or the 7 point socket wrench.

PHP provides a wealth of very useful tools that you can choose to use or not. I don't know why people think my 7 point socket wrench is dumb, it works quite well to round the edges of 6 sided bolts and saves a lot of money on buying those special bolts that can't be removed once tightened.

Re:Every C99.php shell is backdoored by ars on Tuesday June 24, 2014 @04:32PM (#7940400)
If this is the quality of the argument then I have nothing to concern myself with.

Your post might be [slightly] humorous, but as an argument against PHP language constructs it fails miserably.

Re:Every C99.php shell is backdoored by steego on Wednesday June 25, 2014 @12:25AM (#7942234)
It really doesn't. Especially when you see people pulling out the double claw hammers at your company.

Features that have limited real benefits with lots of risk get abused all the time. They are the retarded tools of the world creating technical debt for everybody else and they should be retired.

Extract is one of the stupidist language feature conceived precisely because it puts something so ripe for abuse into the hands of idiots. It even has a simple name that practically encourages its abuse.

Re:Every C99.php shell is backdoored by fleitz on Wednesday June 25, 2014 @03:35AM (#7942682)
Yup, then you see people building sine wave roads for the square wheels they build last week.

Or making critical parts of infrastructure work by a cron job that calls wget.

For some reason PHP needs extract, because a dictionary just won't do.

  foo["var_x"]

  // for some reason needs to be:

  $var_x
Re:Every C99.php shell is backdoored by officialjunk on Thursday June 26, 2014 @02:47AM (#7948407)
I think you mean catenaries, not sine waves.
Re:Every C99.php shell is backdoored by yeahbutbut on Tuesday June 24, 2014 @10:00AM (#7937746)
> "Let's make a function that has the side effect of introducing variables into scope. That's a great idea."

And ``let'' is? ;-)

Doing a (let [request] (check-auth ...)) would be equally dumb. Let's not blame the tools.

Re:Every C99.php shell is backdoored by jsn on Tuesday June 24, 2014 @10:32AM (#7937946)
That's not not how 'let' works, you can't do that with 'let'. You most definitely should blame the tools here.
Re:Every C99.php shell is backdoored by yeahbutbut on Tuesday June 24, 2014 @12:17PM (#7938556)
You're right, let is a macro so you can't pass binding forms from a variable, my mistake. But surely Scheme has some function for binding variables to the local scope...

My point is that trusting user input is the error, not having the ability to play with the scope.

Re:Every C99.php shell is backdoored by gdwatson on Tuesday June 24, 2014 @12:50PM (#7938755)
Scheme has forms that add bindings to the local scope -- local defines -- but they're similar in spirit to let. There aren't any such functions in standard Scheme, and I don't know of any major implementation that has any. It's not clear how they would interact with macros or macro hygiene, and they would do unpleasant things to lexical scope which is Scheme's original schtick.