original_string: public static function extract($collection, $value, $key = null, $default = null)
      {
          $results = [];
  
          [$value, $key] = static::extractKeyValueParameters($value, $key);
  
          foreach ($collection as $item) {
              $itemValue = static::walk($item, $value, $default);
  
              if (is_null($key)) {
                  $results[] = $itemValue;
              } else {
                  $itemKey = static::walk($item, $key, $default);
  
                  $results[$itemKey] = $itemValue;
              }
          }
  
          return $results;
      }
code: public static function extract($collection, $value, $key = null, $default = null)
      {
          $results = [];
  
          [$value, $key] = static::extractKeyValueParameters($value, $key);
  
          foreach ($collection as $item) {
              $itemValue = static::walk($item, $value, $default);
  
              if (is_null($key)) {
                  $results[] = $itemValue;
              } else {
                  $itemKey = static::walk($item, $key, $default);
  
                  $results[$itemKey] = $itemValue;
              }
          }
  
          return $results;
      }
code_tokens: public static function extract ( $ collection , $ value , $ key = null , $ default = null ) { $ results = [ ] ; [ $ value , $ key ] = static :: extractKeyValueParameters ( $ value , $ key ) ; foreach ( $ collection as $ item ) { $ itemValue = static :: walk ( $ item , $ value , $ default ) ; if ( is_null ( $ key ) ) { $ results [ ] = $ itemValue ; } else { $ itemKey = static :: walk ( $ item , $ key , $ default ) ; $ results [ $ itemKey ] = $ itemValue ; } } return $ results ; }
docstring: Extracts values from a Collection, array or set of objects
  
  @param array|Collection  $collection
  @param string|array      $value
  @param string|array|null $key
  @param mixed|null        $default
  
  @return array
docstring_tokens: Extracts values from a Collection array or set of objects