I have the following situation :
?php
class A {
public $var1;
}
class B extends A {
public $var2;
}
?
Now I want to print this object
?php
$obj = new B;
print_r($obj);
?
Does anybody know how I can print class A also ?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe,
Mathijs,
Mathijs wrote:
I have the following situation :
?php
class A {
public $var1;
}
class B extends A {
public $var2;
}
?
Now I want to print this object
?php
$obj = new B;
print_r($obj);
?
Does anybody know how I can print class A also ?
The above prints out:
David Grant wrote:
Mathijs,
Mathijs wrote:
I have the following situation :
?php
class A {
public $var1;
}
class B extends A {
public $var2;
}
?
Now I want to print this object
***object***
?php
$obj = new B;
print_r($obj);
?
Does anybody know how I can print class A also
Jochem,
Good point. I thought he meant object given his example. :P
David
Jochem Maas wrote:
David Grant wrote:
Mathijs,
Mathijs wrote:
I have the following situation :
?php
class A {
public $var1;
}
class B extends A {
public $var2;
}
?
Now I want to print this object
4 matches
Mail list logo