<?php
$a = array('1', '2', 'n');
$c = SomeClass::method_1()
->method_2()
->{ что-то на подобии foreach($a as $b) {
вызываем n-раз method_3($b) }}
->method_m();
class Chain
{
protected $data;
public static function first() {
$c = new Chain();
return $c;
}
public function second($data) {
$r = current($data);
while(next($data)) {
var_dump($r);
$this->data[] = $r + 3;
$this->second($data);
}
return $this;
}
public function three() {var_dump($this->data); }
}
$a = array(1,2,3);
Chain::first()->second($a)->three();