last() public méthode

If the element is array, ArrayObject is returned, else StringObject is returned.
public last ( ) : StringObject | ArrayObject | StdObjectWrapper
Résultat Webiny\Component\StdLib\StdObject\StringObject\StringObject | ArrayObject | StdObjectWrapper The last element in the array.
Exemple #1
0
 /**
  * @dataProvider arraySet1
  */
 public function testLast($array)
 {
     $a = new ArrayObject($array);
     $last = $a->last();
     $this->assertSame(end($array), $last->val());
 }