last() public method

If the element is array, ArrayObject is returned, else StringObject is returned.
public last ( ) : StringObject | ArrayObject | StdObjectWrapper
return Webiny\Component\StdLib\StdObject\StringObject\StringObject | ArrayObject | StdObjectWrapper The last element in the array.
コード例 #1
0
ファイル: ArrayObjectTest.php プロジェクト: Webiny/Framework
 /**
  * @dataProvider arraySet1
  */
 public function testLast($array)
 {
     $a = new ArrayObject($array);
     $last = $a->last();
     $this->assertSame(end($array), $last->val());
 }