Skip to content

Instantly share code, notes, and snippets.

@irfanbaigse
Created March 31, 2018 12:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save irfanbaigse/a948849b0a1fad22f3372da650953f41 to your computer and use it in GitHub Desktop.
Save irfanbaigse/a948849b0a1fad22f3372da650953f41 to your computer and use it in GitHub Desktop.
php token get all
<?php
$tokens = token_get_all('<?php echo; ?>');
foreach ($tokens as $token) {
if (is_array($token)) {
echo "Line {$token[2]}: ", token_name($token[0]), " ('{$token[1]}')", PHP_EOL;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment