Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:36853 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 16557 invoked from network); 7 Apr 2008 17:12:21 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Apr 2008 17:12:21 -0000 Authentication-Results: pb1.pair.com header.from=cschneid@cschneid.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=cschneid@cschneid.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain cschneid.com from 195.226.6.51 cause and error) X-PHP-List-Original-Sender: cschneid@cschneid.com X-Host-Fingerprint: 195.226.6.51 darkcity.gna.ch Linux 2.6 Received: from [195.226.6.51] ([195.226.6.51:56985] helo=mail.gna.ch) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5C/65-26449-3F55AF74 for ; Mon, 07 Apr 2008 13:12:20 -0400 Received: from localhost (localhost [127.0.0.1]) by darkcity.gna.ch (Postfix) with ESMTP id 1FA7016EAE0; Mon, 7 Apr 2008 19:12:17 +0200 (CEST) Received: from unknown by localhost (amavisd-new, unix socket) id client-XX6EJMUH; Mon, 7 Apr 2008 19:12:15 +0200 (CEST) Received: from [192.168.1.72] (rim-zhgw [195.226.9.186]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by darkcity.gna.ch (Postfix) with ESMTP id C1A8F166E28; Mon, 7 Apr 2008 19:12:14 +0200 (CEST) Message-ID: <47FA55ED.8000007@cschneid.com> Date: Mon, 07 Apr 2008 19:12:13 +0200 User-Agent: Thunderbird 1.5.0.12 (X11/20060911) MIME-Version: 1.0 To: Stanislav Malyshev CC: internals@lists.php.net References: <1207539695.5736.42.camel@pena> <8d7b8c130804062157j60871630r6c3b27c4d3245cb9@mail.gmail.com> <1207576676.5331.49.camel@felipe> <47FA507D.2070108@cschneid.com> <47FA5296.7080502@zend.com> In-Reply-To: <47FA5296.7080502@zend.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Scanned: amavisd-new at gna.ch Subject: Re: [PHP-DEV] Return type hints From: cschneid@cschneid.com (Christian Schneider) Stanislav Malyshev wrote: > I'm not sure I understand - how array_reduce is related to having type > hints? You could make array_reduce to do additional things, but that > doesn't require introducing strong typing into php. The relation between array_reduce and scalar type hints is that API start to enforce certain types where they should not just because the programmer thinks it is a good idea. Currently the third parameter $initial of array_reduce only allows int. So instead of allowing any zval and leaving it to the callback function to deal with it a specific type is enforced. You can work around this by checking for NULL inside the callback and initializing it there but that does not work either if you use a built-in function as callback. - Chris