PhpToken::isIgnorable

(PHP 8)

PhpToken::isIgnorableTells whether the token would be ignored by the PHP parser.

說明

public PhpToken::isIgnorable(): bool

Tells whether the token would be ignored by the PHP parser.

參數(shù)

此函數(shù)沒有參數(shù)。

返回值

A boolean value whether the token would be ignored by the PHP parser (such as whitespace or comments).

范例

示例 #1 PhpToken::isIgnorable() example

<?php
$echo 
= new PhpToken(T_ECHO'echo');
var_dump($echo->isIgnorable());   // -> bool(false)

$space = new PhpToken(T_WHITESPACE' ');
var_dump($space->isIgnorable());  // -> bool(true)

參見