public function testReverse() { $a = function () { (yield 1); (yield 2); (yield 3); }; $this->assertTrue([3, 2, 1] === P::reverse($a())); $this->assertTrue(['2', '1'] === P::reverse(['1', '2'])); $this->assertTrue([1] === P::reverse([1])); $this->assertTrue([] === P::reverse([])); $this->assertTrue(['c' => '3', 'b' => '2', 'a' => '1'] === P::reverse(['a' => '1', 'b' => '2', 'c' => '3'])); }