private static function stringifyArrayElements($array) { $elements = array(); $isAssociative = array_keys($array) !== range(0, sizeof($array) - 1); array_walk($array, function ($element, $key) use(&$elements, $isAssociative) { if ($isAssociative) { $elements[] = "<{$key}> => " . Objects::toString($element); } else { $elements[] = Objects::toString($element); } }); return $elements; }
/** * @see \Components\Object::__toString() \Components\Object::__toString() */ public function __toString() { return Objects::toString($this); }
public static function toString() { return function ($object) { return Objects::toString($object); }; }