@Quietust said:Looks to me like they're using variable variables, one of the rather peculiar features of PHP (though useful in some rare circumstances). This is how it works:
class foo
{
var $bar;
var $baz;
function foo() { $this->bar = 'bar'; $this->baz = 'baz'; }
}
$foo = new foo();
$var = 'bar';
$foo->$var = 'omg';
$var = 'baz';
$foo->$var = 'wtf';
// now $foo->bar is 'omg' and $foo->baz is 'wtf'
Basically, they're copying the properties listed in $BLACK_VARS from $hidden into $control (e.g. if $BLACK_VARS = array('location', 'time', and 'wtf'), it'll do "$control->location = $hidden->location; $control->time = $hidden->time; $control->wtf = $hidden->wtf;").See, I got that it would be using variable variables (as written) but that seemed so wrong for so many reasons, so I assumed the $ before BLACK_VARS had to be a typo. Why would you copy properties like this? And why would you store them in an array named BLACK_VARS? And why would you use a for loop instead of foreach? I honestly believe PHP is a great language, but it gives you too much ropte to hang yourself with.