예제 #1
0
 public function testApply()
 {
     $sum = function (...$nums) {
         return Std::foldl(function ($acc, $value) {
             return $acc + $value;
         }, 0, $nums);
     };
     $this->assertEqualsMatrix([[28, Std::apply($sum, [1, 2, 3, 4, 5, 6, 7])], ['hello world', Std::apply(Std::class . '::concat', ['hello ', 'world'])]]);
 }