#33983 [Fbk->Opn]: bugy result from get_all_tokens()

From: Date: Wed, 03 Aug 2005 17:30:49 +0000
Subject: #33983 [Fbk->Opn]: bugy result from get_all_tokens()
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-82899@lists.php.net to get a copy of this message
ID: 33983 User updated by: smart at open-publisher dot net Reported By: smart at open-publisher dot net -Status: Feedback +Status: Open Bug Type: Unknown/Other Function Operating System: XP PHP Version: 5.0.4 New Comment: 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 ---------- Previous Comments: ------------------------------------------------------------------------ [2005-08-03 18:19:29] tony2001@php.net Thank you for this bug report. To properly diagnose the problem, we need a short but complete example script to be able to reproduce this bug ourselves. A proper reproducing script starts with <?php and ends with ?>, is max. 10-20 lines long and does not require any external resources such as databases, etc. If possible, make the script source available online and provide an URL to it here. Try to avoid embedding huge scripts into the report. ------------------------------------------------------------------------ [2005-08-03 18:14:59] 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(). ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=33983&edit=1

« previous php.bugs (#82899) next »