A small tool used to check the published file during the previous release, and matched the call of class, method, and function with regular expressions, at that time, the selected method was to use regular expressions in combination with the daily full and incremental update of the custom symbol table. During use, there are often false positives, so I thought of the token_get_all () function, which will
A small tool used to check the published file during the previous release, and matched the call of class, method, and function with regular expressions, at that time, the selected method was to use regular expressions in combination with the daily full and incremental update of the custom symbol table. During use, there are often false positives, so I thought of the token_get_all () function, which will
A small tool used to check the published file during the previous release, and matched the call of class, method, and function with regular expressions, at that time, the selected method was to use regular expressions in combination with the daily full and incremental update of the custom symbol table. During use, there are often false positives, so I thought of the token_get_all () function, which will parse the syntax of your input variables and generate tokens, one value is the constant value of the token in the php parser. Check the php doc and find that only the list is listed, but the corresponding value is not matched .. for code syntax, refer to the corresponding value T_ABSTRACT abstract class (available from PHP 5.0.0) 342 T_AND_EQUAL & = value assignment operator 272 T_ARRAY array (), array syntax 359 T_ARRAY_CAST (array) type conversion 293 T_AS foreach 325 T_BAD_CHARACTER except \ t (0 × 09), \ n (0x0a), and \ r (0x0d) before ASCII 32) any character other than 312 T_BOOLEAN_AND & logical operator 278 T_BOOLEAN_OR | logical operator 277 T_BOOL_CAST (bool) or (boolean) [...]
Original article address: php parser code, thanks to the original author for sharing.