Bug #13703: PHP allows function redefinition
| From: | yasuo_ohgaki at yahoo dot com | Date: | Wed, 17 Oct 2001 03:14:30 +0000 |
| Subject: | Bug #13703: PHP allows function redefinition | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-68087@lists.php.net to get a copy of this message | ||
From: yasuo_ohgaki@yahoo.com
Operating system: linux 2.4.4/glibc 2.2.2
PHP version: 4.0CVS-2001-10-16
PHP Bug Type: Scripting Engine problem
Bug description: PHP allows function redefinition
Found this bug while I'm doing copy & paste.
Current CVS version (both HEAD and RC) allows redefinition of function
(method). I think this should be fixed before 4.1.0 release.
Following code compiles/runs. PHP executes first function test().
<?php
class A
{
function test()
{
echo "A->test()\n";
}
function test()
{
echo "Another A->test()\n";
}
}
$obj = new A;
$obj->test();
?>
--
Edit bug report at: http://bugs.php.net/?id=13703&edit=1