- array_map: documentation ( source)
- token_get_all: documentation ( source)
- token_name: documentation ( source)
<?php
array_map(
function ($token) {
if (is_array($token)) {
echo token_name($token[0]);
}
},
token_get_all('$a = [1]')
);