本文整理汇总了PHP中Token::isEqual方法的典型用法代码示例。如果您正苦于以下问题:PHP Token::isEqual方法的具体用法?PHP Token::isEqual怎么用?PHP Token::isEqual使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Token
的用法示例。
在下文中一共展示了Token::isEqual方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testIsEqual
public function testIsEqual()
{
$p = new Position(5, 10);
$t = new Token(Token::LITERAL, "foo", $p);
$this->assertTrue($t->isEqual("foo"));
$this->assertFalse($t->isEqual("bar"));
$this->assertFalse($t->isNotEqual("foo"));
$this->assertTrue($t->isNotEqual("bar"));
}
示例2: testPhpTokens
public function testPhpTokens()
{
$this->assertPhpToken('abstract', Token::_abstract());
$this->assertPhpToken('array', Token::_array());
$this->assertPhpToken('as', Token::_as());
$this->assertPhpToken('break', Token::_break());
$this->assertPhpToken('callable', Token::_callable());
$this->assertPhpToken('case', Token::_case());
$this->assertPhpToken('catch', Token::_catch());
$this->assertPhpToken('class', Token::_class());
$this->assertPhpToken('clone', Token::_clone());
$this->assertPhpToken('const', Token::_const());
$this->assertPhpToken('continue', Token::_continue());
$this->assertPhpToken('declare', Token::_declare());
$this->assertPhpToken('default', Token::_default());
$this->assertPhpToken('die', Token::_die());
$this->assertPhpToken('do', Token::_do());
$this->assertPhpToken('echo', Token::_echo());
$this->assertPhpToken('else', Token::_else());
$this->assertPhpToken('elseif', Token::_elseIf());
$this->assertPhpToken('empty', Token::_empty());
$this->assertPhpToken('enddeclare', Token::_endDeclare());
$this->assertPhpToken('endfor', Token::_endFor());
$this->assertPhpToken('endforeach', Token::_endForeach());
$this->assertPhpToken('endif', Token::_endIf());
$this->assertPhpToken('endswitch', Token::_endSwitch());
$this->assertPhpToken('endwhile', Token::_endWhile());
$this->assertPhpToken('eval', Token::_eval());
$this->assertPhpToken('exit', Token::_exit());
$this->assertPhpToken('extends', Token::_extends());
$this->assertPhpToken('final', Token::_final());
$this->assertPhpToken('for', Token::_for());
$this->assertPhpToken('foreach', Token::_foreach());
$this->assertPhpToken('function', Token::_function());
$this->assertPhpToken('global', Token::_global());
$this->assertPhpToken('goto', Token::_goto());
$this->assertPhpToken('if', Token::_if());
$this->assertPhpToken('implements', Token::_implements());
$this->assertPhpToken('include', Token::_include());
$this->assertPhpToken('include_once', Token::_includeOnce());
$this->assertPhpToken('instanceof', Token::_instanceOf());
$this->assertPhpToken('insteadof', Token::_insteadOf());
$this->assertPhpToken('interface', Token::_interface());
$this->assertPhpToken('isset', Token::_isset());
$this->assertPhpToken('list', Token::_list());
$this->assertPhpToken('namespace', Token::_namespace());
$this->assertPhpToken('new', Token::_new());
$this->assertPhpToken('print', Token::_print());
$this->assertPhpToken('private', Token::_private());
$this->assertPhpToken('protected', Token::_protected());
$this->assertPhpToken('public', Token::_public());
$this->assertPhpToken('require', Token::_require());
$this->assertPhpToken('require_once', Token::_requireOnce());
$this->assertPhpToken('return', Token::_return());
$this->assertPhpToken('static', Token::_static());
$this->assertPhpToken('switch', Token::_switch());
$this->assertPhpToken('throw', Token::_throw());
$this->assertPhpToken('trait', Token::_trait());
$this->assertPhpToken('try', Token::_try());
$this->assertPhpToken('unset', Token::_unset());
$this->assertPhpToken('use', Token::_use());
$this->assertPhpToken('var', Token::_var());
$this->assertPhpToken('while', Token::_while());
$this->assertPhpToken('and', Token::logicalAnd());
$this->assertPhpToken('or', Token::logicalOr());
$this->assertPhpToken('xor', Token::logicalXor());
$this->assertPhpToken('(array)', Token::arrayCast());
$this->assertPhpToken('(bool)', Token::booleanCast(), FALSE);
$this->assertPhpToken('(boolean)', Token::booleanCast());
$this->assertPhpToken('(real)', Token::doubleCast(), FALSE);
$this->assertPhpToken('(float)', Token::doubleCast(), FALSE);
$this->assertPhpToken('(double)', Token::doubleCast());
$this->assertPhpToken('(int)', Token::integerCast(), FALSE);
$this->assertPhpToken('(integer)', Token::integerCast());
$this->assertPhpToken('(object)', Token::objectCast());
$this->assertPhpToken('(string)', Token::stringCast());
$this->assertPhpToken('(unset)', Token::unsetCast());
$this->assertPhpToken('__halt_compiler', Token::haltCompiler());
$this->assertPhpToken('__CLASS__', Token::classConstant());
$this->assertPhpToken('__DIR__', Token::dirConstant());
$this->assertPhpToken('__FILE__', Token::fileConstant());
$this->assertPhpToken('__FUNCTION__', Token::functionConstant());
$this->assertPhpToken('__LINE__', Token::lineConstant());
$this->assertPhpToken('__METHOD__', Token::methodConstant());
$this->assertPhpToken('__NAMESPACE__', Token::namespaceConstant());
$this->assertPhpToken('__TRAIT__', Token::traitConstant());
$this->assertPhpToken('=>', Token::doubleArrow());
$this->assertPhpToken('->', Token::objectOperator());
$this->assertPhpToken('::', Token::doubleColon());
$this->assertPhpToken('&=', Token::bitwiseAndAssign());
$this->assertPhpToken('|=', Token::bitwiseOrAssign());
$this->assertPhpToken('^=', Token::bitwiseXorAssign());
$this->assertPhpToken('*=', Token::multiplyAssign());
$this->assertPhpToken('/=', Token::divideAssign());
$this->assertPhpToken('%=', Token::modulusAssign());
$this->assertPhpToken('+=', Token::addAssign());
$this->assertPhpToken('-=', Token::subtractAssign());
$this->assertPhpToken('.=', Token::concatAssign());
$this->assertPhpToken('===', Token::isIdentical());
$this->assertPhpToken('==', Token::isEqual());
//.........这里部分代码省略.........