php8.5
Home/ Manual/ tokenizer / phptoken/ PhpToken::isIgnorable

PhpToken::isIgnorable

PHP function Edit on GitHub ✎

(PHP 8)

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

Description

PhpToken::isIgnorable(): bool

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

Parameters Parameters

Return Values

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

Examples

PhpToken::isIgnorable() example

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

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

See Also

Source: reference/tokenizer/phptoken/isIgnorable.xml · from the official PHP manual (php/doc-en)