|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-07-26 07:35 UTC] armageddon at raydan dot de
When I run the icq_main.php script, after some seconds I get following two errors:
Fatal error: Maximum execution time of 5 seconds exceeded in j:\www\public\phpicq\icq\icq_main.php on line 48
Fatal error: Maximum execution time of 5 seconds exceeded in j:\www\public\phpicq\icq\icq_debug.php on line 121
Ok, thats the excepted behaviour, but when I reload the page I get this strange error:
Fatal error: Cannot redeclare hexdump() (previously declared in :67) in j:\www\public\phpicq\icq\icq_debug.php on line 71
When I reload it again I get the first two error-messages again and so on...
The following code is from icq_debug, Line 67-71:
function HexDump($in) {
static $hex;
if (!$hex) $hex = new Hex();
return $hex->Dump($in);
}
I have loaded the following modules:
php_bz2.dll, php_cpdf.dll, php_crack.dll, php_db.dll, php_dba.dll, php_dbase.dll, php_exif.dll, php_filepro.dll, php_gd.dll, php_gettext.dll, php_hyperwave.dll, php_ldap.dll, php_mhash.dll, php_pdf.dll, php_pgsql.dll, php_shmop.dll, php_snmp.dll, php_sockets.dll, php_w32api.dll, php_zlib.dll
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 13:00:02 2025 UTC |
I got it ! Seems that when a function is declared in an included file, after a top level "return", it's detected as already defined example with ?t1.php? : <?php error_log("inc t2"); include("t2.php"); toto(); error_log("re-inc t2"); include("t2.php"); toto(); error_log("end"); ?> and ?t2.php? : <?php error_log("in t2"); if (defined("_T2_INCLUDED")) { error_log("already went there"); return; } define("_T2_INCLUDED", "1"); error_log("still in t2"); function toto() { echo "Here am I !!\n"; } error_log("end of t2"); ?> with cli sapi of php5 RC1 or with today snapshot, here is the output : inc t2 in t2 still in t2 end of t2 Here am I !! re-inc t2 Fatal error: Cannot redeclare toto() (previously declared in .../t2.php:13) in .../t2.php on line 14 note that even the "in t2" log is not displayed at second include.I have sort of the same bug I think. test.php <?php function test() { echo 'test'; } test(); ?> works fine the first time. Then after a reload it gives an cannot redeclare test() error. Same error after second reload etc. Modify the file (add a space or something like that) and it runs OK the first time but after reload same error. I have compiled PHP 5.2.4 on Darwin Kernel Version 8.10.2.PS This only happened within a checkout page of ZenCart ("part 3 of 3") and not another (not the login page) ... I don't know enough about zc to know what the significant difference is....adding some more comments to my above. here is the simplest sample i've created: redeclare_issue_main.php: ----------------------------- <?php include ('redeclare_issue_test.inc.php'); include ('redeclare_issue_test.inc.php'); sendMail1(); ?> ----------------------------- redeclare_issue_test.inc.php: ----------------------------- <?php function sendMail1() { echo 'test'; } ?> ----------------------------- running the redeclare_issue_main.php code after any change (e.g. add blank line) to redeclare_issue_test.inc.php will bring up: Fatal error: Cannot redeclare sendmail1() in redeclare_issue_test.inc.php on line 2 upon browser reload the error is gone. cannot confirm my previous assumption that also change in PHP related server config cause that the error reappears. OS: FreeBSD 6.3-STABLE-20080418.1500 Apache 2.0 Handler (20051115) PHP Version 5.2.12