|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-03-29 10:47 UTC] tony2001@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Mon Feb 16 14:00:01 2026 UTC |
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.