Parameter checking in 5.2
| From: | Christian Schneider | Date: | Wed, 20 Sep 2006 19:11:27 +0000 |
| Subject: | Parameter checking in 5.2 | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-25774@lists.php.net to get a copy of this message | ||
In the discussion about parameter checking in 5.2 I proposed to relax
the checks a tiny little bit: Don't test static functions (e.g. useful
for factory methods) and allow adding default values to functions (the
object of the inherited class still accepts the same parameters as the
base class). A patch is attached.
Example:
class Base
{
static function factory($x) { }
function foo($x) { }
}
class Spezialized extends Base
{
static function factory() { } # Static method, e.g. factory method
function foo($x = null) { } # Default values for specialized class
}
Regards,
- Chris