public function testDiffAcceptsCallback() { $source = [0 => 'foo', 1 => 'bar', 2 => 'ab', 3 => 'x', 4 => 'f-g-h']; $expected = [2 => 'ab', 3 => 'x', 4 => 'f-g-h']; $xao = new XArray($source); $test = new CallbackTestMethods(); $obj = $xao->diff(['abc'], [$test, 'length_compare']); $this->assertEquals($expected, (array) $obj); }