|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2005-08-03 18:14 UTC] smart at open-publisher dot net
Description: ------------ When parsing files that contains mixed html + php code with the function get_all_tokens() the returned array contains a lot of html fragments. Also when parsing some files the returned array cause heavy problems. The Server return "document contains no data". But the same file is correctly parsed by the php interpreter. So i think the problem is the function get_all_tokens(). PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 08:00:01 2025 UTC |
You can see that the array $tokens contains html fragments <?php $tokens = token_get_all(file_get_contents("test.php")); echo "<pre>";var_dump($tokens);echo "</pre>"; ?> ---- snip - test.php file to parse ---------- <html> <head> <meta name="keywords" content=""> <title>SMART3 - <?php echo "Hello World"; ?></title> <script language="JavaScript" type="text/JavaScript"> </script> </head> <body> </body> </html> ---- end snip - test.php file to parse ----------Thanks for the lovely tip ... RTFM. The problem is that the content of this array that the function get_all_tokens() return throw php in nirvana. Server message: "Document contains no data". It toke hours to find out that this bug is undebugable just by analyzing code line by line. A simple class methode which is correctly executed until the last bracked hangs. class test { } It's definetely a php internal error.