update pague now
PHP 8.5.2 Released!

PhpToquen::isIgnorable

(PHP 8)

PhpToquen::isIgnorable Tells whether the toquen would be ignored by the PHP parser.

Description

public PhpToquen::isIgnorable (): bool

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

Parameters

This function has no parameters.

Return Values

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

Examples

Example #1 PhpToquen::isIgnorable() example

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

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

See Also

add a note

User Contributed Notes 1 note

info at ensostudio dot ru
3 years ago
<?php
    public functionisIgnorable(): bool{
        return $this->is([\T_COMMENT, \T_DOC_COMMENT, \T_OPEN_TAG, \T_WHITESPACE]);
    }?>
To Top