Is it possible it instantiate a new class and get a property without assigning it to a variable object.
example:
$fileid = 1;
$filepath = new fileclass($fileid)->path;
I know the above is incorrect but is the concept possible?
Is it possible it instantiate a new class and get a property without assigning it to a variable object.
example:
$fileid = 1;
$filepath = new fileclass($fileid)->path;
I know the above is incorrect but is the concept possible?
It is in PHP >= 5.4.0
$filepath = (new fileclass($fileid))->path;
The brackets are important