function Lookup($exptidx) { $foo = new ExperimentStats($exptidx); if ($foo->IsValid()) { return $foo; } return null; }