[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

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

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

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

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

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

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

[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,