According to the PHP manual $a should be available to b.inc in the following code segment:
<?php
$a = 1;
include 'b.inc';
?>
However when I try to do the same when calling a static method, $a seems to be out of scope.
class foo {
public static function bar() {
$a = 1;
include('b.inc');
}
}
foo::bar();
Am I misunderstanding something? EDIT: Okay, I'm an idiot, everybody. I was using a wrapper function for the include -- to fill in the include path. This took the variable out of scope. Thanks for the help.