Bug #30075 [Com]: Cannot redeclare function/class

From: Date: Sat, 08 May 2010 15:39:54 +0000
Subject: Bug #30075 [Com]: Cannot redeclare function/class
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-150276@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=30075&edit=1

 ID:               30075
 Comment by:       rmac at iki dot fi
 Reported by:      kj at legalizer dot dk
 Summary:          Cannot redeclare function/class
 Status:           No Feedback
 Type:             Bug
 Package:          Scripting Engine problem
 Operating System: WinXP
 PHP Version:      5CVS-2004-09-13 (dev)

 New Comment:

I found out one way how this error message can happen: it happens if you
declare a 
function with a reserved name. So try changing the name of function to
something 
else.


Previous Comments:
------------------------------------------------------------------------
[2010-03-10 09:38:30] eugenio at blux dot org

Same problem (Cannot redeclare functions...) with php 5.2.3 and IIS 6 on
windows 2003 Small Business Server. Php in ISAPI.

------------------------------------------------------------------------
[2008-09-29 21:23:54] jherer at gmail dot com

Having the same problem with 5.1.0 on windows 2003. Is there a solution

for this problem?

------------------------------------------------------------------------
[2008-02-11 01:55:34] wes at clevemail dot net

I am brand new to PHP. Here are my particulars with this problem. I am
running:

Windows XP 5.1.2600 Service Pack 2 Build 2600
IIS 5.1
PHP 5.2.5 installed from php-5.2.5-Win32.zip
  defined to IIS using php5isapi.dll
MySQL 5.0.51a Win32
phpMyAdmin 2.1.4

I built a test page that only contains phpinfo(). It loads fine.

When I load phpMyAdmin, I get the login page. After supplying my user
name and password, I get:

Fatal error: Cannot redeclare pma_ifsetor() (previously declared in
D:\My Web Sites\phpMyAdmin\libraries\core.lib.php:38) in D:\My Web
Sites\phpMyAdmin\libraries\core.lib.php on line 45

Notice that the previous declaration and the current declaration are in
the same file (including the same path) at different line numbers. The
fact is that in this file, line 38 is the PMA_ifSetOr() function
declaration, while line 45 is then end of the fPMA_ifSetOr function
(i.e. the ending "}"):

38 function PMA_ifSetOr(&$var, $default = null, $type = 'similar')
39 {
40     if (! PMA_isValid($var, $type, $default)) {
41         return $default;
42     }
43 
44     return $var;
45 }


One other interesting observation: If I restart IIS and then press F5,
the page then loads successfully. Once I get this error, pressing F5
returns the same error until I restart IIS. Then (at least every time so
far), the page loads fine.

------------------------------------------------------------------------
[2007-11-27 18:53:39] brianleeholub at yahoo dot com

After trying apache 2.2.4 on the same machine/same php the content
flashes up and then firefox goes to an error page. In the event log I
get this:

Event Type:	Error
Event Source:	Application Error
Event Category:	(100)
Event ID:	1000
Date:		11/27/2007
Time:		10:47:14 AM
User:		N/A
Computer:	BH-DEV4
Description:
Faulting application httpd.exe, version 2.2.4.0, faulting module
php5ts.dll, version 5.2.5.5, fault address 0x000ce75a.

For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp.
Data:
0000: 41 70 70 6c 69 63 61 74   Applicat
0008: 69 6f 6e 20 46 61 69 6c   ion Fail
0010: 75 72 65 20 20 68 74 74   ure  htt
0018: 70 64 2e 65 78 65 20 32   pd.exe 2
0020: 2e 32 2e 34 2e 30 20 69   .2.4.0 i
0028: 6e 20 70 68 70 35 74 73   n php5ts
0030: 2e 64 6c 6c 20 35 2e 32   .dll 5.2
0038: 2e 35 2e 35 20 61 74 20   .5.5 at 
0040: 6f 66 66 73 65 74 20 30   offset 0
0048: 30 30 63 65 37 35 61      00ce75a

------------------------------------------------------------------------
[2007-11-27 18:34:44] brianleeholub at yahoo dot com

This is happening in 5.2.5 (also win2k3-sp2, iis6, isapi). Since most of
the pages in the application I'm testing are fairly complex, I created a
test script with a single function to do some basic math. After browsing
around a bit in the main application (and seeing the "redeclare" bug,
probably 15% of the page loads, with random functions being the culprit
even when reloading the same page), I pointed at my test script and
refreshed once or twice and got: PHP has encountered an Access Violation
at 01B09F7E

The main application is heavy in SOAP.

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


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

    http://bugs.php.net/bug.php?id=30075


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


Thread (13 messages)

« previous php.bugs (#150276) next »