- Output for 8.1.0 - 8.1.31, 8.2.0 - 8.2.26, 8.3.0 - 8.3.15, 8.4.1 - 8.4.2
- Line 1: T_OPEN_TAG ('<?php ') Line 2: T_ECHO ('echo') Line 2: T_WHITESPACE (' ') Line 2: T_CONSTANT_ENCAPSED_STRING ('""')
<?php
$tokens = token_get_all(<<<EOF
<?php
echo "";
EOF
);
foreach ($tokens as $token) {
if (is_array($token)) {
echo "Line {$token[2]}: ", token_name($token[0]), " ('{$token[1]}')", PHP_EOL;
}
}