I've been looking at Magic Constants and Reflection in PHP to see if the following is possible:
function one() {
setVars();
// $node would be in scope
print_r($node);
}
function setVars() {
return $node = '2';
}
Is this a classical programming concept? Reflection seems to be the closest thing. Basically, I just want to define variables in a different scope (the scope/context of the function that called the setVars() function).
$nodewouldnt be in scope there. you would have to do$node = setVars()... unless im missing something.extract... or jsut use the variables in the array.listsyntax like in the example I posted, which was made for this purpose.setVars)?