ID: 46339 Updated by: [EMAIL PROTECTED] Reported By: amanank at yahoo dot com -Status: Open +Status: Bogus Bug Type: Performance problem Operating System: Windows 2000 PHP Version: 5.2.6 New Comment:
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php Previous Comments: ------------------------------------------------------------------------ [2008-10-19 06:25:48] amanank at yahoo dot com Description: ------------ I have a problem; I am generating php files on the fly and storing them on the server; in case the server is out of disk space or for some other bazaar reason the generated files may get corrupted. So when loading next time will result in a parse error. In this case I simply want to be able to catch the parse error and delete the file so that it can be re-generated next time. I tried exec('php -l my_file.php'); but this takes over 5 seconds to run. Loading 10's of include files with 1000s of lines of code to generate a page is a lot faster then checking whether a single file has parse errors. There must be a better way? Reproduce code: --------------- <?php $time_start = microtime(true); exec('php -l c:/web/temp/my_file_with_parse_errors.php'); $time_end = microtime(true); $time = $time_end - $time_start; echo "took $time seconds to check for parse errors :(\n"; ?> Expected result: ---------------- took 0.0001 seconds to check for parse errors :( Actual result: -------------- took 5.345 seconds to check for parse errors :( ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=46339&edit=1