= 0 && is_array($t[$k]) && $t[$k][0] === T_WHITESPACE; $k--); $prev = $t[$k]; if (is_array($prev) && in_array($prev[0], [T_OBJECT_OPERATOR, T_DOUBLE_COLON, T_FUNCTION, T_NEW, T_NULLSAFE_OBJECT_OPERATOR], true)) continue; $calls[strtolower($t[$i][1])][] = basename($f) . ':' . $t[$i][2]; } } } foreach ($defined as $name => $where) if (count($where) > 1) echo "DUP $name: " . implode(' ', $where) . "\n"; foreach ($calls as $name => $where) { if (isset($defined[$name]) || function_exists($name) || in_array($name, ['array','list','isset','empty','unset','exit','die','eval','match','fn','declare'])) continue; echo "UNDEF $name: " . implode(' ', array_slice($where, 0, 4)) . (count($where) > 4 ? ' ...' : '') . "\n"; }