Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:84435 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 913 invoked from network); 8 Mar 2015 13:54:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Mar 2015 13:54:29 -0000 Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.171 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.171 mail-we0-f171.google.com Received: from [74.125.82.171] ([74.125.82.171:42828] helo=mail-we0-f171.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BD/72-17427-4945CF45 for ; Sun, 08 Mar 2015 08:54:29 -0500 Received: by wesq59 with SMTP id q59so12092177wes.9 for ; Sun, 08 Mar 2015 06:54:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=UDX0a/QWGAfzMZny8voPTa36IwX4cEe39oDprKhu4A8=; b=ILlAY2TfSIXlhTZMjpb0yt6YCe20BpO8PtSlsdvdgWNXaFXQw1tABpaLKQuXCwovSu Knv05tUr4sFPcceU4FTCmiMNrCj2aUhUBvIzg85uhL2jPWQJI9Rrs/JY7Dci6aOBLNIZ Z8PbpNG1eH3TULg/14/rsolaJCyzXHnCmTFKQq0qF3mjuXrMk43GFbmRaLxBrimTz9TX kMLoFvOkDxFIgU2xEEUB9yRR7mzYQ/CyVawif45wNuiu9lD8vlDfGqyALjQGLX5Bnl6T I0pgIuIgciDB92KAeH055xLD0RMe+gSX6dpoywGh9L/3amjOWee1Zfqe5HIQd0Il7ENh DMyQ== X-Received: by 10.180.77.110 with SMTP id r14mr30521968wiw.89.1425822866205; Sun, 08 Mar 2015 06:54:26 -0700 (PDT) Received: from [192.168.0.5] (cpc68956-brig15-2-0-cust215.3-3.cable.virginm.net. [82.6.24.216]) by mx.google.com with ESMTPSA id r3sm23890360wjw.7.2015.03.08.06.54.23 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 08 Mar 2015 06:54:24 -0700 (PDT) Message-ID: <54FC5477.1040305@gmail.com> Date: Sun, 08 Mar 2015 13:53:59 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: "internals@lists.php.net" References: <54F83061.60108@seld.be> <54FB44EE.6000704@gmail.com> <6805F3C6-E73F-4A00-A94A-FE38B7E6D90F@gmail.com> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Re: [RFC] [DISCUSSION] Consistent Function Names From: rowan.collins@gmail.com (Rowan Collins) On 08/03/2015 01:25, Yasuo Ohgaki wrote: > Hi Rowan, > > On Sun, Mar 8, 2015 at 8:31 AM, Rowan Collins > wrote: > > What? That's not the same thing at all. I'm pretty sure those > functions are deprecated *because* we have array callback forms, > so you can use call_user_func to call a method. > > PHP has a well-defined definition of "callable", as used by > is_callable() and function parameter typehints, and literally > everywhere that wants a callback. Since there's no such thing as a > function or method pointer, that definition includes a string > identifying a plain function, and two array forms, [string, > string] and [object, string], representing static and instance > methods, respectively. You can't not accept those forms as a > callback parameter in one particular function just to make things > tidier. > > > I should have written "Let deprecate _all_ array callbacks" by > document and raise deprecate error in PHP7. > Remove array callbacks in PHP 8. In favour of what? We have no other way of telling a function expecting a callback to use an existing method. And why? Because one particular function signature you want to create would be possible if "array" and "callback" were non-overlapping type hints? Is there something wrong with having a function that explicitly tells people it takes callbacks, rather than guessing based on the arguments you pass in? Regards, -- Rowan Collins [IMSoP]