/** * Test compare() works correctly. */ public function testCompare() { $this->assertEquals('0', String::compare('foo', 'foo')); $this->assertLessThan('0', String::compare('foo', 'Foobar')); $this->assertGreaterThan('0', String::compare('foobar', 'Foo')); $this->assertEquals('0', String::compare('foo', 'Foobar', 3)); $this->assertGreaterThan('0', String::compare('foobar', 'Foo', 5)); }
function str_compare($string, $value, $strict = true, $length = 0) { return String::compare($string, $value, $strict, $length); }