slice() публичный Метод

Extract a portion of an indexed array
public slice ( array $array, string $begin, string $end = null ) : array
$array array The array (with numeric indices)
$begin string
$end string
Результат array
 /**
  * @test
  * @dataProvider sliceExamples
  */
 public function sliceWorks($array, $begin, $end, $expected)
 {
     $helper = new ArrayHelper();
     if ($end !== null) {
         $result = $helper->slice($array, $begin, $end);
     } else {
         $result = $helper->slice($array, $begin);
     }
     $this->assertEquals($expected, $result);
 }