|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-03-07 20:04 UTC] sniper@php.net
[2005-03-20 18:11 UTC] sniper@php.net
[2005-03-22 22:55 UTC] paul dot laughlin at ingramentertainment dot com
[2005-04-12 20:29 UTC] gary dot every at ingramentertainment dot com
[2005-05-17 13:33 UTC] gary dot every at ingramentertainment dot com
[2005-08-18 23:44 UTC] gevery at gmail dot com
[2005-09-02 08:52 UTC] sniper@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Nov 25 20:00:01 2025 UTC |
Description: ------------ If you have a fatal error it breaks token_get_all until an apache restart... Reproduce code: --------------- -- Sample Token file <test.file> Some HTML <? TEST_TAG ?> Some More HTML <? Another_TAG ?> More HTML -- End Sample Token File -- PHP Script -- <?php $rawData = file_get_contents('test.file'); foreach (token_get_all($rawData) as $token) { echo '<pre>'; print_r($token); echo '</pre>'; } ?> -- End PHP Script -- If you introduce a parse error as follows, fix the error and reload you get broken output until apache restart. <?php broken... $rawData = file_get_contents('test.file'); foreach (token_get_all($rawData) as $token) { echo '<pre>'; print_r($token); echo '</pre>'; } ?> Expected result: ---------------- Array ( [0] => 310 [1] => Some HTML ) Array ( [0] => 365 [1] => Array ( [0] => 368 [1] => ) Array ( [0] => 306 [1] => TEST_TAG ) Array ( [0] => 368 [1] => ) Array ( [0] => 367 [1] => ?> ) Array ( [0] => 310 [1] => Some More HTML ) Array ( [0] => 365 [1] => Array ( [0] => 368 [1] => ) Array ( [0] => 306 [1] => Another_TAG ) Array ( [0] => 368 [1] => ) Array ( [0] => 367 [1] => ?> ) Array ( [0] => 310 [1] => More HTML ) Actual result: -------------- Array ( [0] => 306 [1] => Some ) Array ( [0] => 368 [1] => ) Array ( [0] => 306 [1] => HTML ) Array ( [0] => 368 [1] => ) < ? Array ( [0] => 368 [1] => ) Array ( [0] => 306 [1] => TEST_TAG ) Array ( [0] => 368 [1] => ) Array ( [0] => 367 [1] => ?> ) Array ( [0] => 310 [1] => Some More HTML ) Array ( [0] => 365 [1] => Array ( [0] => 368 [1] => ) Array ( [0] => 306 [1] => Another_TAG ) Array ( [0] => 368 [1] => ) Array ( [0] => 367 [1] => ?> ) Array ( [0] => 310 [1] => More HTML )