Re: [PHP] Cannot redeclare function

2004-08-10 Thread Jason Wong
On Wednesday 11 August 2004 05:18, Alex Hogan wrote:

> Apparently I must've been calling it from someplace else that I can't
> find, and changing to include_once() fixed the problem.  I just don't
> understand why it worked for as long as it did before now.

Once upon a time PHP allowed a function to be declared multiple times.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
When I met th'POPE back in '58, I scrubbed him with a MILD SOAP or
DETERGENT for 15 minutes.  He seemed to enjoy it ...
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Cannot redeclare function

2004-08-10 Thread Alex Hogan
[snip]
> Well, it's very likely that that file was being included 
> twice. You just can't do an include() on the same file twice 
> if it defines functions or classes. Look through your code 
> and see all of the places where the include was happening. 
> Perhaps the file that includes that file is being included twice.
[/snip]

I checked that.  I have all the includes at the top of the page only
being brought in from a config file.
I checked the config file for that directory and it only calls the files
once.  No duplication.
I even checked the classes to insure that there wasn't any duplicate
functionality or duplicate calls.

Apparently I must've been calling it from someplace else that I can't
find, and changing to include_once() fixed the problem.  I just don't
understand why it worked for as long as it did before now.


alex hogan
*
The contents of this e-mail and any files transmitted with it are confidential and 
intended solely for the use of the individual or entity to whom it is addressed. The 
views stated herein do not necessarily represent the view of the company. If you are 
not the intended recipient of this e-mail you may not copy, forward, disclose, or 
otherwise use it or any part of it in any form whatsoever. If you have received this 
e-mail in error please e-mail the sender. 
*

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Cannot redeclare function

2004-08-10 Thread Justin Patrin
On Tue, 10 Aug 2004 14:07:09 -0500, Alex Hogan
<[EMAIL PROTECTED]> wrote:
> > Did your error_reporting level change with the upgrade? This
> > was more than likely silently ignored with PHP4 and now
> > showing as a warning/error in PHP5 or just dependent upon
> > your error_reporting level.
> 
> No..,
> 
> I was careful to set 5 up with as many of the same settings as the
> previous version.  I only had half a day to change the production
> environment so I wanted to make sure there was no lag.  Unless there was
> something that I missed.
> 
> At first I thought that I had either duplicated the function someplace
> else, but that wasn't the case.
> 

Well, it's very likely that that file was being included twice. You
just can't do an include() on the same file twice if it defines
functions or classes. Look through your code and see all of the places
where the include was happening. Perhaps the file that includes that
file is being included twice.

> 
> alex hogan
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder

paperCrane --Justin Patrin--

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Cannot redeclare function

2004-08-10 Thread Alex Hogan
> Did your error_reporting level change with the upgrade? This 
> was more than likely silently ignored with PHP4 and now 
> showing as a warning/error in PHP5 or just dependent upon 
> your error_reporting level.

No..,

I was careful to set 5 up with as many of the same settings as the
previous version.  I only had half a day to change the production
environment so I wanted to make sure there was no lag.  Unless there was
something that I missed.

At first I thought that I had either duplicated the function someplace
else, but that wasn't the case.


alex hogan
*
The contents of this e-mail and any files transmitted with it are confidential and 
intended solely for the use of the individual or entity to whom it is addressed. The 
views stated herein do not necessarily represent the view of the company. If you are 
not the intended recipient of this e-mail you may not copy, forward, disclose, or 
otherwise use it or any part of it in any form whatsoever. If you have received this 
e-mail in error please e-mail the sender. 
*

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Cannot redeclare function

2004-08-10 Thread Ed Lazor
It's probably not PHP 5 and more likely that someone changed the php.ini
error reporting settings in the process of upgrading (or maybe PHP 5 has a
different set of default settings?).

You should probably trace through your application and note what files are
being loaded, in what order, etc.. so thath you can identify why the error
occurred.  Using include_once fixes the problem but may not address bigger
issues.

-Ed


> -Original Message-
> Hi All,
> 
> 
> I have a registration page that hasn't changed in several weeks.  Today
> it decided to freak-out by throwing an error;
> 'Cannot redeclare myfunctionname() on line 10 of myfunctions.inc'
> 
> Nothing has changed in either the calling page, or the function.  The
> only thing that has changed since these files were put into production
> is the upgrade on php to 5.
> 
> I've looked through the release notes and found nothing.  I looked
> through the manual and found nothing that I can really put my finger on.
> I was able to correct the problem with changing the 'include()' to
> 'include_once()', but I really want to know why this happened and why it
> didn't throw that error until now.
> 
> 
> alex hogan

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Cannot redeclare function

2004-08-10 Thread John W. Holmes
From: "Alex Hogan" <[EMAIL PROTECTED]>
> I have a registration page that hasn't changed in several weeks.  Today
> it decided to freak-out by throwing an error;
> 'Cannot redeclare myfunctionname() on line 10 of myfunctions.inc'
>
> Nothing has changed in either the calling page, or the function.  The
> only thing that has changed since these files were put into production
> is the upgrade on php to 5.

Did your error_reporting level change with the upgrade? This was more than
likely silently ignored with PHP4 and now showing as a warning/error in PHP5
or just dependent upon your error_reporting level.

---John Holmes...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Cannot redeclare function

2004-08-10 Thread Alex Hogan
Hi All,


I have a registration page that hasn't changed in several weeks.  Today
it decided to freak-out by throwing an error;
'Cannot redeclare myfunctionname() on line 10 of myfunctions.inc'

Nothing has changed in either the calling page, or the function.  The
only thing that has changed since these files were put into production
is the upgrade on php to 5.

I've looked through the release notes and found nothing.  I looked
through the manual and found nothing that I can really put my finger on.
I was able to correct the problem with changing the 'include()' to
'include_once()', but I really want to know why this happened and why it
didn't throw that error until now.


alex hogan

 

*
The contents of this e-mail and any files transmitted with it are confidential and 
intended solely for the use of the individual or entity to whom it is addressed. The 
views stated herein do not necessarily represent the view of the company. If you are 
not the intended recipient of this e-mail you may not copy, forward, disclose, or 
otherwise use it or any part of it in any form whatsoever. If you have received this 
e-mail in error please e-mail the sender. 
*

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Cannot Redeclare Function

2002-09-19 Thread Robert Miller

Hello,

My function to read a comma separated text file and return a sorted multi-dimensional 
array will not work if used more than once per page.

I know why I'm having this problem. But, I don't know how to solve it. :-(





Calling it Twice:
$services = tbl2array ("../locations/service.txt", "default", $divdetail['id'], "0");
$collections = tbl2array ("../download/collection.txt", "name", $divdetail['id'], "4");


The Error:
Fatal error: Cannot redeclare compname() in ../tbl2array.inc on line 35


Function Table 2 Array:




--
Robert J. Miller
Internet Support Specialist
Department of Government Services and Lands
P.O. Box 8700, St. John's, NF., A1B-4J6
(709) 729-4520 (phone)
(709) 729-4151 (facsimile)
(709) 778-8746 (pager)

http://www.gov.nf.ca/gsl/
mailto:[EMAIL PROTECTED]
--
Simple things should be simple and hard things
should be possible.
--


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php