I'm just curious if it's possible to get the value of a class variable when making an object of it? What I'd like to do is:
$class = new MyClass("something")->ok;
For the example above, the class is:
class MyClass {
public $ok;
public function __construct($a) {
$this->ok = $a;
}
}
I know it's easy to get the value of $a by writing one more line, but I'm really curious if it's possible to do in a shorter way.