Newsgroups: php.cvs,php.internals Path: news.php.net Xref: news.php.net php.cvs:62978 php.internals:48984 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 21636 invoked from network); 28 Jun 2010 18:17:42 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Jun 2010 18:17:42 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 67.192.241.153 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 67.192.241.153 smtp153.dfw.emailsrvr.com Linux 2.6 Received: from [67.192.241.153] ([67.192.241.153:53873] helo=smtp153.dfw.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 51/D1-09012-547E82C4 for ; Mon, 28 Jun 2010 14:17:42 -0400 Received: from relay15.relay.dfw.mlsrvr.com (localhost [127.0.0.1]) by relay15.relay.dfw.mlsrvr.com (SMTP Server) with ESMTP id 68A3A30B015A; Mon, 28 Jun 2010 14:17:38 -0400 (EDT) Received: by relay15.relay.dfw.mlsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id E37B430B0174; Mon, 28 Jun 2010 14:17:37 -0400 (EDT) Message-ID: <4C28E741.1070506@sugarcrm.com> Date: Mon, 28 Jun 2010 11:17:37 -0700 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.1.10) Gecko/20100512 Thunderbird/3.0.5 MIME-Version: 1.0 To: Etienne Kneuss CC: =?ISO-8859-1?Q?Johannes_Schl=FCter?= , Felipe Pena , "php-cvs@lists.php.net" , PHP internals list References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-CVS] Re: [PHP-DEV] Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_2/Zend/tests/bug51421.phpt branches/PHP_5_2/Zend/zend_compile.c branches/PHP_5_3/Zend/tests/bug51421.phpt branches/PHP_5_3/Zend/zend_compile.c trunk/Zend/tests/bug51421.phpt tru... From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! > 1) arguments can be gathered dynamically in the function, using > func_get_args. For that reason, PHP gracefully allow a call with too many > arguments. Isn't it the case today? Maybe also we can add some syntax like: function foo($a, $b, ...) - where ... means "I'll deal with those arguments myself, ignore any compatibility checks" so if the prototype is foo($a,$b,$c) $a and $b would be checked but not $c and the function is considered to have enough args. > 2) a child method should be allowed to define type hints in a contra-variant > manner (currently, it's invariant) This needs to be fixed. > 3) a child method should be allowed to return a ref even if the parent > method is not defined to do so. (returning a ref is an additional > constraint, and following co-variance of return values, it should be > allowed). The basic example of this annoyance is: abstract class A > implements ArrayAcces { public function&__offsetGet($name) { ... } } This needs to be fixed too. > 4) all in all: it shouldn't throw a fatal error, those are not critical > situations for the engine. I'd say in general OO part of PHP seems to be much more strict and Java-like than the rest. I'm not sure it's good. I'd demote all situations where the engine has a way to proceed to at least warning level. > I'd like to propose to relax such checks, by either allowing more (e.g. 1, 2 > and 3) which can be painful and complicated, or simply removing those > checks. I think we shouldn't remove them - we should fix them. It doesn't seem to be too hard, IMHO. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227