|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-12-11 00:52 UTC] felipe@php.net
[2008-01-21 01:34 UTC] felipe@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 09:00:02 2025 UTC |
Description: ------------ When trying to enforce arguments on constructors, PHP behaves unexpectedly. If you define the constructor as an abstract method in a parent level class, the __construct method argument datatype/count checks go out the window in children. This issue is the same whether its in an interface or abstract class. Reproduce code: --------------- class ExampleClass {} interface TestInterface { public function __construct(ExampleClass $var); } class Test implements TestInterface { public function __construct() {} // NO ERROR (unexpected) } Expected result: ---------------- Should produce an error Actual result: -------------- No error is reported.