#23042 [Com]: Cannot redefine function in class
ID: 23042
Comment by: webmaster at mentch dot net
Reported By: patrice dot ferlet at wanadoo dot fr
Status: Bogus
Bug Type: Scripting Engine problem
Operating System: Linux mandrake 9.1
PHP Version: 4.3.1
New Comment:
I have had the same experience. In PHP 4.2.2, I could have a function
name with multiple declarations with different parameters. However, I
just migrated the site to a server that has PHP 4.3.5 and it crashed
with that same fatal error?? What gives?
In PHP 4.2.2 and earlier, I could use both functions prototypes
successfully when they were in the same class...
Previous Comments:
------------------------------------------------------------------------
[2003-04-04 14:38:56] patrice dot ferlet at wanadoo dot fr
the fact is here... ;o)
http://copix.aston.fr with php 4.1 and http://www.metal3d.com/copix php
4.3.1
this is the same code source...
------------------------------------------------------------------------
[2003-04-04 02:48:24] wez@php.net
We fixed a bug so that it displays a warning when you try to do this.
It never actually worked in earlier releases (try it!), and we never
stated that you could overload functions in this way in the manual.
------------------------------------------------------------------------
[2003-04-04 01:50:17] patrice dot ferlet at wanadoo dot fr
try this:
class test
{
function blah ($one, $two)
{
echo "ONE\n";
}
function blha ($one, $two, $three)
{
echo "TWO";
}
}
In OOP, we can declare several prototypes of a class method, in php 4.0
i could do this, but with php 4.3.1 i cannot anymore.
I think this is a very important problem.
For a framework i use (and i contribute) this is a real big problem!
------------------------------------------------------------------------
[2003-04-03 19:40:07] sniper@php.net
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php
If you can provide more information, feel free to add it
to this bug and change the status back to "Open".
Thank you for your interest in PHP.
------------------------------------------------------------------------
[2003-04-03 16:48:01] patrice dot ferlet at wanadoo dot fr
Fatal error: Cannot redeclare copixaction() in
/var/www/html/newcopix/utils/copix/core/CopixAction.class.php on line
59
Last version of PHP worked but not today with 4.3.1.
I cannot redefine a function in class... but i do oop !
thanks
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=23042&edit=1
Thread (6 messages)