Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:36855 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 21221 invoked from network); 7 Apr 2008 17:40:11 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Apr 2008 17:40:11 -0000 Authentication-Results: pb1.pair.com smtp.mail=mls@pooteeweet.org; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=mls@pooteeweet.org; sender-id=unknown Received-SPF: error (pb1.pair.com: domain pooteeweet.org from 85.10.196.195 cause and error) X-PHP-List-Original-Sender: mls@pooteeweet.org X-Host-Fingerprint: 85.10.196.195 serveforce1.backendmedia.com Linux 2.6 Received: from [85.10.196.195] ([85.10.196.195:46243] helo=serveforce1.backendmedia.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 16/46-26449-A7C5AF74 for ; Mon, 07 Apr 2008 13:40:11 -0400 Received: from [192.168.178.43] (brln-d9ba7e71.pool.mediaWays.net [217.186.126.113]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (Client did not present a certificate) by serveforce1.backendmedia.com (Postfix) with ESMTP id A32CA1224B15; Mon, 7 Apr 2008 19:39:57 +0200 (CEST) Cc: Christian Schneider , Felipe Pena , internals@lists.php.net Message-ID: <736AB4E9-0139-4DFC-8A49-8735FF742E8A@pooteeweet.org> To: Stanislav Malyshev In-Reply-To: <47FA5296.7080502@zend.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v919.2) Date: Mon, 7 Apr 2008 19:39:42 +0200 References: <1207539695.5736.42.camel@pena> <8d7b8c130804062157j60871630r6c3b27c4d3245cb9@mail.gmail.com> <1207576676.5331.49.camel@felipe> <47FA507D.2070108@cschneid.com> <47FA5296.7080502@zend.com> X-Mailer: Apple Mail (2.919.2) X-backendmedia-com-MailScanner-Information: Please contact the ISP for more information X-backendmedia-com-MailScanner: Found to be clean X-backendmedia-com-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=0, required 6) X-backendmedia-com-MailScanner-From: mls@pooteeweet.org X-Spam-Status: No Subject: Re: [PHP-DEV] Return type hints From: mls@pooteeweet.org (Lukas Kahwe Smith) On 07.04.2008, at 18:57, Stanislav Malyshev wrote: > Hi! > >> I just ran into this (IMHO unnecessary) limitation with array_reduce: >> Why should it only reduce to an int? Why not a string or an array? I >> plan on submitting a patch for PHP 6 to allow other types too. > > 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. PHP should be as flexible about types as possible. I never used array_reduce() so I do not know its history. But some of you might remember the change in behavior from array_merge() which was the result of a switch to a more strict parameter parsing API, which now returns false when you pass in NULL. A fair amount of people believe that this is the wrong direction to take. Continuously expanding type hints relates to this concern. regards, Lukas