Bug #18590 [Com]: Fatal error: Cannot redeclare upon reload

From: Date: Thu, 25 Jul 2013 15:41:53 +0000
Subject: Bug #18590 [Com]: Fatal error: Cannot redeclare upon reload
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-180480@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=18590&edit=1

 ID:                 18590
 Comment by:         ukvuidivud at sfkilr dot com
 Reported by:        armageddon at raydan dot de
 Summary:            Fatal error: Cannot redeclare upon reload
 Status:             No Feedback
 Type:               Bug
 Package:            Scripting Engine problem
 Operating System:   WinXP Pro
 PHP Version:        5.0.0-dev
 Block user comment: N
 Private report:     N

 New Comment:

zzylhcvht/qiq/ofu, <a href="http://clomidid.com/">Clomid statics</a>,
hsRyJpJ, [url=http://clomidid.com/]Drug clomid[/url],
ZQCCmHw, http://clomidid.com/ Clomid, NQgkNdv.


Previous Comments:
------------------------------------------------------------------------
[2010-01-28 16:54:49] krajicek at centrum dot sk

...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

------------------------------------------------------------------------
[2010-01-28 09:27:38] krajicek at centrum dot sk

confirming the same (similar) issue - if file with function definition is included twice (via
include) in the script run it throws Fatal Error - Cannot redeclare functionXY. on reload the Fatal
Error is gone. on any change to script or PHP related server config is error back again. fix for the
error message is to use include_once instead of include.
but this can cause problems by not displaying error messages all the times.

OS: FreeBSD 6.3-STABLE-20080418.1500
Apache 2.0 Handler (20051115)
PHP Version 5.2.12

------------------------------------------------------------------------
[2009-02-04 20:44:55] greg at pwsdb dot com

Tenative Conclusion: php has already loaded and defined everything. 
pear should not be re-loading or re-defining anything. 
this is the conflict.   
[the possibility of any exception(s) is the source of the conflict]

------------------------------------------------------------------------
[2009-02-04 17:31:51] greg at pwsdb dot com

system notes:
zencart Version 1.3.8a
Server OS: Linux 2.6.18-53.1.14.el5.centos.plus
HTTP Server: Apache/2.2.3 (CentOS)
PHP Version: 5.1.6 (Zend: 2.1.0)

------------------------------------------------------------------------
[2009-02-04 17:22:29] greg at pwsdb dot com

PPS 
  I now remember a few months ago I added code to a pgm I had written 
to access another $_POST variable. I also moved the call to my program
(in  includes/modules/pages/checkout_confirmation/header_php.php) down
past some error checking.  I immediately started getting "Fatal error:"
messages about things being defined twice throughout many (untouched) zc pgms.:
i 'undid' things but could not stop it until I had changed all the 
require()  calls to  require_once() 

Fatal error: Cannot redeclare class order in /.../includes/classes/order.php on line 1018
Fatal error: Cannot redeclare class shipping in /.../includes/classes/shipping.php on line 178
Fatal error: Cannot redeclare class order_total in /.../includes/classes/order_total.php on line 232
Fatal error: Cannot redeclare class payment in /.../includes/classes/payment.php on line 255
Fatal error: Cannot redeclare class cc_validation in /.../includes/classes/cc_validation.php on line
184
and more. 

again, it has to be "php vs. pear" (?) 
this was in  "PHP Version 5.1.6".  From the comments above, it must 
still be in  Ver. 5.2.4

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=18590


-- 
Edit this bug report at https://bugs.php.net/bug.php?id=18590&edit=1


Thread (30 messages)

« previous php.bugs (#180480) next »