I'm trying to access the return value of the test()
inside __constructor()
but I stucked it. anyone Can tell me about that how can I get the return value from __constructor()
. I appreciate your answer!
class some
{
public function __construct()
{
$this->test(); // I want this test()
}
public function test()
{
return 'abc';
}
}
$some = new some;
echo $some;
print_r($some);
I tried by myself, but nothing happens!
Thanks!