SqlParser\Context::isBool PHP Method

isBool() public static method

This actually check only for TRUE and FALSE because 1 or 0 are actually numbers and are parsed by specific methods.
public static isBool ( string $str ) : boolean
$str string String to be checked.
return boolean
    public static function isBool($str)
    {
        $str = strtoupper($str);
        return $str === 'TRUE' || $str === 'FALSE';
    }

Usage Example

Example #1
0
 public function testIsBool()
 {
     $this->assertTrue(Context::isBool('true'));
     $this->assertTrue(Context::isBool('false'));
     $this->assertFalse(Context::isBool('tru'));
     $this->assertFalse(Context::isBool('falsee'));
 }
All Usage Examples Of SqlParser\Context::isBool