PHP 8.2.31
Preview: ReadonlyFunctionTokenEmulator.php Size: 976 B
/opt/cpanel/ea-wappspector/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReadonlyFunctionTokenEmulator.php

<?php declare(strict_types=1);

namespace PhpParser\Lexer\TokenEmulator;

use PhpParser\PhpVersion;

/*
 * In PHP 8.1, "readonly(" was special cased in the lexer in order to support functions with
 * name readonly. In PHP 8.2, this may conflict with readonly properties having a DNF type. For
 * this reason, PHP 8.2 instead treats this as T_READONLY and then handles it specially in the
 * parser. This emulator only exists to handle this special case, which is skipped by the
 * PHP 8.1 ReadonlyTokenEmulator.
 */
class ReadonlyFunctionTokenEmulator extends KeywordEmulator {
    public function getKeywordString(): string {
        return 'readonly';
    }

    public function getKeywordToken(): int {
        return \T_READONLY;
    }

    public function getPhpVersion(): PhpVersion {
        return PhpVersion::fromComponents(8, 2);
    }

    public function reverseEmulate(string $code, array $tokens): array {
        // Don't bother
        return $tokens;
    }
}

Directory Contents

Dirs: 0 × Files: 14

Name Size Perms Modified Actions
3.27 KB lrw-r--r-- 2025-12-06 11:56:16
Edit Download
1.44 KB lrw-r--r-- 2025-12-06 11:56:16
Edit Download
701 B lrw-r--r-- 2025-12-06 11:56:16
Edit Download
1.53 KB lrw-r--r-- 2025-12-06 11:56:16
Edit Download
1.79 KB lrw-r--r-- 2025-12-06 11:56:16
Edit Download
422 B lrw-r--r-- 2025-12-06 11:56:16
Edit Download
2.23 KB lrw-r--r-- 2025-12-06 11:56:16
Edit Download
1.41 KB lrw-r--r-- 2025-12-06 11:56:16
Edit Download
437 B lrw-r--r-- 2025-12-06 11:56:16
Edit Download
976 B lrw-r--r-- 2025-12-06 11:56:16
Edit Download
905 B lrw-r--r-- 2025-12-06 11:56:16
Edit Download
1013 B lrw-r--r-- 2025-12-06 11:56:16
Edit Download
819 B lrw-r--r-- 2025-12-06 11:56:16
Edit Download
3.04 KB lrw-r--r-- 2025-12-06 11:56:16
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).