Parkour\Traverse::each PHP Method

each() public static method

Iterates over the given data.
public static each ( array $data, callable $cb )
$data array Data.
$cb callable Function that receives values.
    public static function each(array $data, callable $cb)
    {
        array_walk($data, $cb);
    }

Usage Example

 /**
  *
  */
 public function testEach()
 {
     $data = ['a' => 1, 'b' => 2];
     $closure = $this->closure([[1, 'a', null], [2, 'b', null]]);
     Traverse::each($data, $closure);
 }