#38529 [Opn->Bgs]: cunstructor overloading is not allowed in php5
| From: | tony2001@php.net | Date: | Mon, 21 Aug 2006 08:41:40 +0000 |
| Subject: | #38529 [Opn->Bgs]: cunstructor overloading is not allowed in php5 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-101043@lists.php.net to get a copy of this message | ||
ID: 38529
Updated by: tony2001@php.net
Reported By: suneelbadola at yahoo dot com
-Status: Open
+Status: Bogus
Bug Type: Feature/Change Request
Operating System: Linux/Windows
PHP Version: 5.1.5
New Comment:
Function overloading is not supported and never going to be, since PHP
is weakly typed language.
Previous Comments:
------------------------------------------------------------------------
[2006-08-21 04:18:03] suneelbadola at yahoo dot com
Description:
------------
The constructor over loading is not allowed in PHP however for being
OOPS based language it should.
Reproduce code:
---------------
class PDF extends FPDF
{
public function __construct($one){
echo "one";
}
public function __construct($one,$two){
echo "two";
}
public function __construct(){
echo "blank";
}
}
Expected result:
----------------
it should allow us contructor overloading.
Actual result:
--------------
error: can not redeclare function.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=38529&edit=1