Called 500-1k times per request, this change reduces the time spent inside this method by about 40% on average.
return;
}
- if (!isset($this->data['userOption' . $optionID])) {
- return;
- }
-
- return $this->data['userOption' . $optionID];
+ return $this->data['userOption' . $optionID] ?? null;
}
/**
public function __get($name)
{
$value = parent::__get($name);
- if ($value === null) {
- $value = $this->getUserOption($name);
- }
- return $value;
+ return $value ?? $this->getUserOption($name);
}
/**