Fw: [?? Probable Spam] Bug #42314 [Opn->Bgs]: bug in function declaration
| From: | ramymb at gmail dot com | Date: | Thu, 16 Aug 2007 06:33:22 +0000 |
| Subject: | Fw: [?? Probable Spam] Bug #42314 [Opn->Bgs]: bug in function declaration | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-36229@lists.php.net to get a copy of this message | ||
----- Original Message ----- From: "PHP Bug Database" <php-bugs@lists.php.net>
To: <ramymb@gmail.com>
Sent: Thursday, August 16, 2007 9:23 AM
Subject: [?? Probable Spam] Bug #42314 [Opn->Bgs]: bug in function declaration
ATTENTION! Do NOT reply to this email! To reply, use the web interface found at http://bugs.php.net/?id=42314&edit=2ID: 42314 Updated by: jani@php.net Reported By: ramymb at gmail dot com -Status: Open +Status: Bogus Bug Type: Unknown/Other FunctionOperating System: windows 2003PHP Version: 5.2.3New Comment: 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. Previous Comments: ------------------------------------------------------------------------ [2007-08-16 02:14:22] ramymb at gmail dot com Description: ------------ OS: windows 2003 + IIS PHP Version: 5.2.3 when I'm declare my own function myFun in a file func.php, I'm included into my main index.php, it's working at first time without any problem, when I'm using current page to submit data into the same page I'm getting the following error: Fatal error: Cannot redeclare myfun() (previously declared in C:\accounts\panela\tmp\func.php:2) in C:\accounts\panela\tmp\func.php on line 2 I don't know whats the problem, I'm tried to solve this problem but I'm failed :( this error is not logic, and the same script working in other php version like php 4.X Reproduce code: --------------- --- file: func.php --- <? function myFun($a,$b){ return $a+$b; } ?> --- file: index.php --- <? include_once("func.php"); ?> <form name="FormName" action="" method="post"> <input type="submit" value="Send"> </form> Expected result: ---------------- this code when submit data into same php page. I'm solved this problem by: <? if (!function_exists('myFun')) { function myFun($a,$b){ return $a+$b; } } ?> but unfortunately, when I'm refreshing the page I'm cant see my last editing in my function, for example, now I will edit the function to: <? if (!function_exists('myFun')) { function myFun($a,$b){ return $a*$b; } } ?> now with function_exists I cant see the new function $a*$b, but I'm see only the old function $a-$b. ------------------------------------------------------------------------