php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #32791 It cannot redeclare a function that has only been declared once.
Submitted: 2005-04-21 16:52 UTC Modified: 2005-04-21 17:51 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 1 (0.0%)
From: MIKEYTF at aol dot com Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 4.3.9 OS: Windows 98
Private report: No CVE-ID: None
 [2005-04-21 16:52 UTC] MIKEYTF at aol dot com
Description:
------------
Well, I created a function sys_msg($error,$exit).  Then it says "Cannot redeclare sys_msg() (previously declared in cfg.inc.php on line 44) on line 44".  It does not make sense!

Reproduce code:
---------------
Well, I don't think I need to show a source code because it is just a function..  but here is the error page:  http://subzer0.net/reloaded/

Expected result:
----------------
I expect the index to load and for it to give me an error telling me that some SQL tables are missing.  (I haven't completed all the SQL)

Actual result:
--------------
It gives me the "cannot redeclare" error.  (http://subzer0.net/reloaded)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-04-21 17:00 UTC] tony2001@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try to avoid embedding huge scripts into the report.

Please check that you don't have any of zend_extension's loaded.
 [2005-04-21 17:13 UTC] MIKEYTF at aol dot com
You want me to give you guys the function so you could try it out yourselves?
 [2005-04-21 17:19 UTC] sniper@php.net
How can we test if we don't know what to test?
Create the shortest possible test script you can
and add it here.

 [2005-04-21 17:26 UTC] MIKEYTF at aol dot com
<?php

function sys_msg($error,$exit) {

if($exit==0)
{
echo ''.$error.'';
} elseif($exit==1) {
echo ''.$error.'';

exit;
} elseif(!strlen($exit)) {
echo ''.$error.'';
}
}

if(isset($_POST['submit']))
{
sys_msg('You clicked the button!','0');
} else {
echo '';
}

?>
<form action="<?=$_SERVER['PHP_SELF']?>" method="POST">
<input type="submit" name="submit" value="Click Me" />
</form>



That's the shortest script I could make..
 [2005-04-21 17:34 UTC] tony2001@php.net
Again, please check that you don't have any of zend_extensions like MMCache, ionCube, Zend Optimizer etc.

And your code works fine with all the latest 5.1, 5.0.x & 4.3.x versions .
 [2005-04-21 17:49 UTC] MIKEYTF at aol dot com
Here is the complete config file:  http://subzer0.net/reloaded/cfg.inc.phps

I don't think I have any extensions, as I have never experienced this problem before.
 [2005-04-21 17:51 UTC] sniper@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Nov 22 05:00:01 2025 UTC