public function testISubstringCompare() { $this->eq(s::iSubstringCompare('xabcx', 'ABC', 1, 3), 0); $this->ne(s::iSubstringCompare('xabcx', 'DEF', 1, 3), 0); $this->lt(s::iSubstringCompare('xabcx', 'XYZ', 1, 0), 0); $this->eq(s::iSubstringCompare('xabcx', '', 1, 0), 0); $this->eq(s::iSubstringCompare('xxabc', 'ABC', 2, 5), 0); $this->lt(s::iSubstringCompare('xxabc', 'ABCD', 2, 5), 0); $this->eq(s::iSubstringCompare('xxxxx', '', 5, 5), 0); $this->lt(s::iSubstringCompare('xxxxx', 'A', 5, 5), 0); $this->eq(s::iSubstringCompare('xabcx', '', 10, 5), 0); $this->lt(s::iSubstringCompare('XABCX', 'xyz', 10, 5), 0); $this->eq(s::iSubstringCompare('XXABC', 'abc', 2, null), 0); $this->eq(s::iSubstringCompare('xxabc', 'abc', -3, null), 0); $this->eq(s::iSubstringCompare('abcxx', 'abc', -7, 5), 0); $this->eq(s::iSubstringCompare('abcde', 'abcde', -7, null), 0); $this->eq(s::iSubstringCompare('abcde', '', -15, 5), 0); $this->eq(s::iSubstringCompare('abcde', 'abcde', -15, null), 0); }
public function iSubstringCompare($that, $offset, $length) { return s::iSubstringCompare($this->value, self::unwrap($that), $offset, $length); }