#43557 [NEW]: Abstract constructor arguments can't be enforced

From: Date: Mon, 10 Dec 2007 23:40:50 +0000
Subject: #43557 [NEW]: Abstract constructor arguments can't be enforced
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-120543@lists.php.net to get a copy of this message
From: michikono at gmail dot com Operating system: linux PHP version: 5.2.5 PHP Bug Type: Class/Object related Bug description: Abstract constructor arguments can't be enforced 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. -- Edit bug report at http://bugs.php.net/?id=43557&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=43557&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=43557&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=43557&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=43557&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=43557&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=43557&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=43557&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=43557&r=needscript Try newer version: http://bugs.php.net/fix.php?id=43557&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=43557&r=support Expected behavior: http://bugs.php.net/fix.php?id=43557&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=43557&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=43557&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=43557&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=43557&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=43557&r=dst IIS Stability: http://bugs.php.net/fix.php?id=43557&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=43557&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=43557&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=43557&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=43557&r=mysqlcfg

« previous php.bugs (#120543) next »