News for hackers. Stuff that matters.
Re:Every C99.php shell is backdoored by meritt on Tuesday June 24, 2014 @10:13AM (#7937825)
Or you could do this:

    function qux() { return [$foo, $bar, $baz]; }

    list($foo, $bar, $baz) = qux();
Re:Every C99.php shell is backdoored by stormbrew on Tuesday June 24, 2014 @01:23PM (#7938961)
The problem with this is that it leaves things without any obvious, canonical, name. You have to read a bunch of code to figure out what's going on and a change in the values returned may result in subtle errors.

Coffeescript has a really neat destructuring operator for this kind of thing:

    qux = () -> {blah: "a", blorp: "b", zoop: "c"}
    {blah, blorp, zoop} = quz()
Re:Every C99.php shell is backdoored by ars on Tuesday June 24, 2014 @02:27PM (#7939485)
Yah, I do that when it's just a few variables, but it gets unmanageable when the number starts increasing.

It's also error prone if you have several feeder/user functions since you have to change them in multiple places.

Or if you have two code paths that end up with two different sets of variables (probably controlled by a semaphore variable) then this won't work.