original_string: public static function first($collection = null, $n = null)
      {
          if ($n === 0) {
              return array();
          }
          if (is_null($n)) {
              return current(array_splice($collection, 0, 1, true));
          }
          return array_splice($collection, 0, $n, true);
      }
code: public static function first($collection = null, $n = null)
      {
          if ($n === 0) {
              return array();
          }
          if (is_null($n)) {
              return current(array_splice($collection, 0, 1, true));
          }
          return array_splice($collection, 0, $n, true);
      }
code_tokens: public static function first ( $ collection = null , $ n = null ) { if ( $ n === 0 ) { return array ( ) ; } if ( is_null ( $ n ) ) { return current ( array_splice ( $ collection , 0 , 1 , true ) ) ; } return array_splice ( $ collection , 0 , $ n , true ) ; }
docstring: Get the first element of an array. Passing n returns the first n elements.
docstring_tokens: Get the first element of an array . Passing n returns the first n elements .