php Programming Glossary: token_get_all
How can I find unused functions in a PHP project http://stackoverflow.com/questions/11532/how-can-i-find-unused-functions-in-a-php-project allow me to analyse my codebase for example Reflection token_get_all Are these API's feature rich enough for me not to have to rely.. functions function define_file path functions tokens token_get_all file_get_contents path for i 0 i count tokens i token tokens.. functions function reference_file path functions tokens token_get_all file_get_contents path for i 0 i count tokens i token tokens..
Regular Expression to extract php code partially (( array definition )) http://stackoverflow.com/questions/17118032/regular-expression-to-extract-php-code-partially-array-definition when you asked for a regex it works also with pure PHP. token_get_all is here the key function. For a regex check @HamZa's answer.. than a regex. A regex has a static pattern while with token_get_all you can decide after every single token what to do. It even.. isset VAR defined undefined string_literal 12345 ' token token_get_all php . code newcode i 0 while i count token enter into array..
A tool to add and complete PHP source code documentation http://stackoverflow.com/questions/1936376/a-tool-to-add-and-complete-php-source-code-documentation create an interesting tool using either The Reflection API token_get_all to parse the source of a PHP file. After a bit more searching..
Function list of php file http://stackoverflow.com/questions/2197851/function-list-of-php-file defined in another file you can try using http www.php.net token_get_all like this arr token_get_all file_get_contents 'anotherfile.php'.. can try using http www.php.net token_get_all like this arr token_get_all file_get_contents 'anotherfile.php' Then you can loop through..
Simulate php array language construct or parse with regexp? http://stackoverflow.com/questions/3267951/simulate-php-array-language-construct-or-parse-with-regexp allowedChars array ' ' true ' ' true ' ' true tokens token_get_all ' php '. code array_shift tokens remove opening php tag foreach..
What kinds of patterns could I enforce on the code to make it easier to translate to another programming language? http://stackoverflow.com/questions/3455456/what-kinds-of-patterns-could-i-enforce-on-the-code-to-make-it-easier-to-translat Syntax Tree. Apparently the closest I can get with PHP is token_get_all which is a start. From then on I can build the AST symbol tables..
Is there a static code analyzer [like Lint] for PHP files? [closed] http://stackoverflow.com/questions/378959/is-there-a-static-code-analyzer-like-lint-for-php-files PHP Mess Detector Lower level analyzers include PHP_Parser token_get_all primitive function Run php in lint mode from the command line..
Best way to automatically remove comments from PHP code http://stackoverflow.com/questions/503871/best-way-to-automatically-remove-comments-from-php-code 'T_ML_COMMENT' commentTokens T_ML_COMMENT PHP 4 tokens token_get_all fileStr foreach tokens as token if is_array token if in_array..
Batch script to replace PHP short open tags with <?php http://stackoverflow.com/questions/684587/batch-script-to-replace-php-short-open-tags-with-php p.s. the man page for token_get_all and googleing for creative combinations of tokenizer token_get_all.. and googleing for creative combinations of tokenizer token_get_all and the parser token names might help. p.p.s. see also Regex..
Get class name from file http://stackoverflow.com/questions/7153000/get-class-name-from-file while class if feof fp break buffer . fread fp 512 tokens token_get_all buffer if strpos buffer ' ' false continue for i count tokens.. while class if feof fp break buffer . fread fp 512 tokens token_get_all buffer if strpos buffer ' ' false continue for i count tokens..
reliably convert string containing PHP array info to array [duplicate] http://stackoverflow.com/questions/7873354/reliably-convert-string-containing-php-array-info-to-array str result NULL validate string isValid FALSE tokens token_get_all sprintf ' php s' str array_shift tokens valid array 305 315..
Parse PHP code to extract function names? http://stackoverflow.com/questions/8446099/parse-php-code-to-extract-function-names this question You can use tokenizer to do that print_r token_get_all ' php exec rm rf ' Notice in the output the third element which..
Determining what classes are defined in a PHP class file http://stackoverflow.com/questions/928928/determining-what-classes-are-defined-in-a-php-class-file function get_php_classes php_code classes array tokens token_get_all php_code count count tokens for i 2 i count i if tokens i 2..
|