- Output for 8.1.0 - 8.1.30, 8.2.0 - 8.2.25, 8.3.0 - 8.3.14
- 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;
}
}