|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2005-10-07 18:06 UTC] linus at mccabe dot nu
Description: ------------ This is bug 29761, I'd like to see it reopened. (it might also be 33093, not sure) Create the two php files in 'reproduce code'. Point your browser to 'test.php'. First time you should get the expected result, second the actual result. If you have many apache threads, you might need to refresh a few times until the error occurs. I've tested and reproduced this on: * Windows XP: Apache/2.0.52 (Win32) PHP/5.0.5 * Linux: Apache/1.3.33 (Debian GNU/Linux) PHP/4.3.10-15 (yes, error.php is supposed to have a parser error) thanks for your time /Linus Reproduce code: --------------- error.php: <?php print('abc' ; ?> test.php: <?php header('Content-Type: text/plain'); $first = token_get_all('<?php $a=$b;'); print_r($first); require('error.php'); ?> Expected result: ---------------- Array ( [0] => Array ( [0] => 366 [1] => <?php ) [1] => Array ( [0] => 309 [1] => $a ) [2] => = [3] => Array ( [0] => 309 [1] => $b ) [4] => ; ) <br /> <b>Parse error</b>: parse error, unexpected ';' in <b>C:\Program Files\Apache Group\Apache2\htdocs\error.php</b> on line <b>4</b><br /> Actual result: -------------- Array ( [0] => < [1] => ? [2] => Array ( [0] => 307 [1] => php ) [3] => Array ( [0] => 369 [1] => ) [4] => Array ( [0] => 309 [1] => $a ) [5] => = [6] => Array ( [0] => 309 [1] => $b ) [7] => ; ) <br /> <b>Parse error</b>: parse error, unexpected ';' in <b>C:\Program Files\Apache Group\Apache2\htdocs\error.php</b> on line <b>4</b><br /> PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 04:00:02 2025 UTC |
I did another test and altered test.php to look like: <?php header('Content-Type: text/plain'); register_shutdown_function('term'); $first = token_get_all('<?php $a=$b;'); print_r($first); require('error.php'); function term() { apache_child_terminate(); } ?> After that it gives the correct result every time. This is of course not an ideal solution, but I thought it might give yet another hint that the failing has something to do with the previous script's error. Also, I've tried with other errors than parsing errors (like doing division by zero, trigger_error, etc) but nothing else seems to get php into 'error mode'.