matched() public method

Returns true if the last match was successful.
public matched ( ) : boolean
return boolean
Example #1
0
 public function testMatchedAndGetMatched()
 {
     $s = new StringScanner('test string');
     $this->assertEquals(4, $s->match('/\\w+/'));
     $this->assertEquals('test', $s->matched);
     $this->assertTrue($s->matched());
     $this->assertNull($s->match('/\\d+/'));
     $this->assertNull($s->matched);
     $this->assertFalse($s->matched());
 }