"new" operator question
Posted: Mon Jan 17, 2005 8:49 am
Hi guys.
I'm a little newbie to php, so I have simple question.
Php4 does not allow next code constructions:
Idea in getting function result without declaring class instance variable.
Is it possible or I should use
Thank you in advance.
I'm a little newbie to php, so I have simple question.
Php4 does not allow next code constructions:
Code: Select all
$result = (new SampleClass('x'))->sampleMethod();Code: Select all
($result = new SampleClass('x'))->sampleMethod();Is it possible or I should use
Code: Select all
$sample = new SampleClass('x');
$result = $sample->sampleMethod();Thank you in advance.