$TEST= new TEST;
$a=3;
$b=4;
$TEST->Show();
works, fine
better to use $GLOBALS['a'] instead of global $a
Op woensdag 14 augustus 2002 15:27, schreef Tim Stoop:
> Hi there,
>
> I'm forgetting something, but I can't seem to get to it... Consider the
> following Class.
>
> class Test
> {
>
Not done any OO stuff with PHP, but I would hazard a guess that the
problem is one of scope.
Rather than global making available class variables, it makes available
GLOBAL variables. And I'm guessing there isn't a global variable a or b,
which is why they show up blank.
HTH,
Richy
=
2 matches
Mail list logo