<?php $code = '<?php class Foo { public const NEW = Bar::NEW; }'; foreach (token_get_all($code, TOKEN_PARSE) as $t) { if (is_array($t) && strcasecmp($t[1], 'new') === 0) { echo token_name($t[0]), ' [', $t[1], ']', PHP_EOL; } }
You have javascript disabled. You will not be able to edit any code.