I am looking for the best/correct way to do the following:
myClass::getSomething('stuff'); class myClass { public static function getSomething($var) { $obj = new static(); $obj->var = $var; $obj->somethingElse(); } public function somethingElse() { // I need to access $obj->var in here } } Do I pass $obj to somethingElse(), is that the right way?
getSomethingmethod looks like it belongs to a factory.