This function make sure you are returning a standard object.
public static returnStdObject ( mixed &$var ) : |
||
$var | mixed | |
Результат |
/** * Get the first element in the array. * If the element is array, ArrayObject is returned, else StringObject is returned. * * @return StringObject|ArrayObject|StdObjectWrapper The first element in the array. */ public function first() { $arr = $this->val(); $first = reset($arr); return StdObjectWrapper::returnStdObject($first); }