I have a simple situation:
in a.inc.php:
$a = 1;
in b.class.php
require 'a.inc.php';
class b {
function test() {
global $a;
echo $a;
}
}
With this pattern, $a is NOT visible within class b, even though it
is declared in the global scope and I'm using the global
Marcus Bointon wrote:
I have a simple situation:
in a.inc.php:
$a = 1;
in b.class.php
require 'a.inc.php';
class b {
function test() {
global $a;
echo $a;
}
}
With this pattern, $a is NOT visible within class b, even though it is
declared in the global scope and
On 5 Oct 2005, at 13:37, Jochem Maas wrote:
if changing the declaration in a.inc.php fixes it then you must
NOT be including b.inc.php form the global scope.
Well, that's what I thought, but it just isn't! The include really is
in the global scope outside any class or function definition.
Marcus Bointon wrote:
On 5 Oct 2005, at 13:37, Jochem Maas wrote:
if changing the declaration in a.inc.php fixes it then you must
NOT be including b.inc.php form the global scope.
Well, that's what I thought, but it just isn't! The include really is
in the global scope outside any class
4 matches
Mail list logo