Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:39489 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 36384 invoked from network); 30 Jul 2008 21:06:32 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Jul 2008 21:06:32 -0000 Authentication-Results: pb1.pair.com smtp.mail=smith@pooteeweet.org; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=smith@pooteeweet.org; sender-id=unknown Received-SPF: error (pb1.pair.com: domain pooteeweet.org from 88.198.8.16 cause and error) X-PHP-List-Original-Sender: smith@pooteeweet.org X-Host-Fingerprint: 88.198.8.16 bigtime.backendmedia.com Linux 2.6 Received: from [88.198.8.16] ([88.198.8.16:36024] helo=bigtime.backendmedia.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F8/B5-60483-7D7D0984 for ; Wed, 30 Jul 2008 17:06:32 -0400 Received: from localhost (unknown [127.0.0.1]) by bigtime.backendmedia.com (Postfix) with ESMTP id A35341EBC012; Wed, 30 Jul 2008 21:07:02 +0000 (UTC) X-Virus-Scanned: amavisd-new at backendmedia.com Received: from bigtime.backendmedia.com ([127.0.0.1]) by localhost (bigtime.backendmedia.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZhclC+AmRHA3; Wed, 30 Jul 2008 23:07:01 +0200 (CEST) Received: from [192.168.0.151] (77-57-23-243.dclient.hispeed.ch [77.57.23.243]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: smith@pooteeweet.org) by bigtime.backendmedia.com (Postfix) with ESMTP id 67B574144006; Wed, 30 Jul 2008 23:07:01 +0200 (CEST) Cc: PHP Developers Mailing List , =?ISO-8859-1?Q?Johannes_Schl=FCter?= Message-ID: <2673889B-5552-4CF6-AD95-4A8C63067E46@pooteeweet.org> To: Dmitry Stogov In-Reply-To: <4890D5A2.7030904@zend.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v928.1) Date: Wed, 30 Jul 2008 23:04:45 +0200 References: <4890D5A2.7030904@zend.com> X-Mailer: Apple Mail (2.928.1) Subject: Re: [PHP-DEV] alpha1 status update From: smith@pooteeweet.org (Lukas Kahwe Smith) On 30.07.2008, at 22:57, Dmitry Stogov wrote: >> - remove __toString() from closures (Johannes/Dmitry) > > What is wrong here? > What behavior do you prefer? > I just missed the discussion. This was in the thread "closures questions" and later there were some votes by Stas and Marcus in favor of its removal in the "towards 5.3 alpha1" thread. Here is a comment by Christian about the topic: >>> so do we even want the toString() method? >> IMHO we should drop toString from Closure. > > There is one case which *may* cause problems: > > function doSomething ($callback) { > if (!is_callable ($callback)) { > throw new Exception (...); > } > > // special treatment > if ($callback == 'default') { > ... > } else { > ... > } > } > > Here, the comparison of $callback with 'default' will yield a notice > that $callback couldn't be converted. The comparison will fail > correctly, of course, but it could cause some confusion. The correct > way of comparing would obviously be using ===, that won't cause these > hickups. regards, Lukas Kahwe Smith smith@pooteeweet.org