Suddenly, I'm getting a Fatal error: Cannot redeclare
<p>I'm getting a strange error on a piece of code that used to work perfectly before, but suddenly started pushing out errors...</p>

<p>That's the releavant code:</p>

<pre><code>function cmp($a, $b) {
if ($a == $b) {
    return 0;
}
return ($a &lt; $b) ? -1 : 1;
}

function getFileList($dir)
{
   // array to hold return value
$retval = array();

// add trailing slash if missing
if(substr($dir, -1) != "/") $dir .= "/";

// open pointer to directory and read list of files
$d = @dir($dir) or die("getFileList: Failed opening directory $dir for reading");
while(false !== ($entry = $d-&gt;read())) {
  // skip hidden files
  if($entry[0] == ".") continue;
  if(is_dir("$dir$entry")) {
    $retval[] = array(
      "name" =&gt; "$dir$entry/",
      "type" =&gt; filetype("$dir$entry"),
      "size" =&gt; 0,
      "lastmod" =&gt; filemtime("$dir$entry")
    );
  } elseif(is_readable("$dir$entry")) {
    $retval[] = array(
      "name" =&gt; "$dir$entry",
      "type" =&gt; mime_content_type("$dir$entry"),
      "size" =&gt; filesize("$dir$entry"),
      "lastmod" =&gt; filemtime("$dir$entry")
    );
  }
}
$d-&gt;close();

uasort($retval, 'cmp');
return $retval;
}
</code></pre>

<p>and the error I'm getting is:</p>

<p>Fatal error: Cannot redeclare cmp() (previously declared in /store/cpanel/home/martinak/public_html/modules/mod_supersized/mod_supersized.php:3) in /store/cpanel/home/martinak/public_html/modules/mod_supersized/mod_supersized.php on line 8</p>

<p>Now, the code above does start on line 3 as stated in the error, but line 8 containst just the "}".</p>

<p>As stated the code used to work, it hasn't been changed, and just stopped working after months. Could it be a server configuration problem? Any ideas?</p>

<p>Thanks!
S.</p>

<p>UPDATE:</p>

<p>I'm so sorry guys. I just realized my client messed up my code. I hate when people try to fix things without having the knowledge to do so and then cry for help when they mess it up.</p>

<p>I apologize for wasting your time, I hope you'll forgive me.</p>
