Jump to content

[SOLVED] PHP 'Cannot redeclare function'


Recommended Posts

Ok, I'm getting this error:

Fatal error: Cannot redeclare upload() (previously declared in C:\...\functions.php:2) in C:\...\functions.php on line 110

 

I've gotten this error before, and I know what the main cause is. But this isn't due to declaring a function twice (or atleast I don't see it). Here are lines 2 and 110 of functions.php

 

Line 2 (1-3):

<?php
function upload($set=array()){     // line 2
global $error;

 

Line 110 (109-111):

	return (empty($error)) ? true : false;
}     // line 110
// this is line 111. just a newline

 

What could be the problem? All the braces match up.

 

Wes

Link to comment
https://forums.phpfreaks.com/topic/160303-solved-php-cannot-redeclare-function/
Share on other sites

You're probably including the file twice or something.

 

That was it.. it was hidden.. sorry, that's what happens when you make yourself work on the weekend.

 

I'll bet that the function that ends around line 110 is called upload too.

 

Negative.. it was all the same function. I'm not THAT tired ;)

 

Thanks everyone!

 

Wes

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.