php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26297 Function redeclare
Submitted: 2003-11-18 04:52 UTC Modified: 2003-11-18 04:58 UTC
From: daniel at cyberprune dot com Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 4.3.4 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: daniel at cyberprune dot com
New email:
PHP Version: OS:

 

 [2003-11-18 04:52 UTC] daniel at cyberprune dot com
Description:
------------
Fatal error: Cannot redeclare get_total_topics() (previously declared in /vhost/rollo/rollo.cyberprune.com/portal/exoops/modules/newbb_plus/functions.php:2) in /vhost/rollo/rollo.cyberprune.com/portal/exoops/modules/newbb_plus/functions.php on line 2


Reproduce code:
---------------
<?php
function get_total_topics($forumid)
{
global $db, $bbTable;

if ($forum_id) {
	$sql = "SELECT COUNT(*) AS total FROM ".$bbTable['topics']." WHERE forum_id = '$forum_id'";
	} else {
		$sql = "SELECT COUNT(*) AS total FROM ".$bbTable['topics'];
	}

if (!$result = $db->query($sql)) {
	return(_ERROR);
}

if (!$myrow = $db->fetch_array($result)) {
	return(_ERROR);
}

return($myrow['total']); }

Expected result:
----------------
Function to work


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-11-18 04:58 UTC] daniel at cyberprune dot com
Found problem
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 17 14:04:04 2025 UTC