Re: inheritance check too strict?

From: Date: Thu, 19 Aug 2010 16:45:14 +0000
Subject: Re: inheritance check too strict?
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-49462@lists.php.net to get a copy of this message
Hi!
transparently, because they're specialized of ObjParent. If this function signature was allowed - it can end up calling ObjChild::set() with an argument - which ObjChild() doesn't support.
But it does! It just silently ignores the argument - which it does not need. But you can add as much extra arguments as you want, they always were silently ignored. Also, ObjChild might use func_get_args, etc. to get the arguments.
The other way around - making ObjChild::set() more support more signatures than the signature it's 'overriding' - makes perfect sense and is allowed.
But that's exactly what happens - ObjChild supports more signatures (inclusive!) than ObjParent. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227

« previous php.internals (#49462) next »