Esempio n. 1
0
 public function testHeadLast()
 {
     $this->assertEquals('a', Arrays::first(explode('.', 'a.b')));
     $this->assertEquals('b', Arrays::last(explode('.', 'a.b')));
 }
Esempio n. 2
0
 /**
  * Returns the last element of an array. This is exactly like end() except
  * that it won't warn you if you pass some non-referencable array to
  * it -- e.g., the result of some other array operation.
  *
  * @param    array Array to retrieve the last element from.
  *
  * @return   mixed  The last value of the array.
  * @group util
  *
  * @deprecated
  */
 function last(array $arr)
 {
     return \Packaged\Helpers\Arrays::last($arr);
 }