ID: 40948
Updated by: [EMAIL PROTECTED]
Reported By: jestar342 at hotmail dot com
-Status: Open
+Status: Bogus
-Bug Type: Class/Object related
+Bug Type: Feature/Change Request
Operating System: All
PHP Version: 5.2.1
New Comment:
This behaviour is consistent for all functions including constructors
and we don't have any plans to change it.
Previous Comments:
------------------------------------------------------------------------
[2007-03-29 10:38:17] jestar342 at hotmail dot com
Description:
------------
Instantiating an object from a class with *required* parameters does
not cease instantiation. In my humble opinion, as we have the ability to
use optional parameters, missing required parameters should generate
E_FATAL error.
Reproduce code:
---------------
class Foo
{
public function __construct ($bar)
{}
public function doSomething()
{}
}
$foo = new Foo(); // E_WARNING
$foo->doSomething(); // this will still execute.
Expected result:
----------------
class Foo
{
public function __construct ($bar)
{}
public function doSomething()
{}
}
$foo = new Foo(); // E_FATAL
$foo->doSomething(); // this will not execute.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=40948&edit=1