Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:69646 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 8562 invoked from network); 17 Oct 2013 17:52:10 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Oct 2013 17:52:10 -0000 Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.176 as permitted sender) X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 209.85.217.176 mail-lb0-f176.google.com Received: from [209.85.217.176] ([209.85.217.176:57495] helo=mail-lb0-f176.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F0/04-12663-9C320625 for ; Thu, 17 Oct 2013 13:52:10 -0400 Received: by mail-lb0-f176.google.com with SMTP id y6so2166245lbh.21 for ; Thu, 17 Oct 2013 10:52:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=+zRCm2DRojbOe0FRNzJbVNRay2XKCKC3fr9D9SkSEDU=; b=qLDxihn2/aSNPGLfBqmG3eJDsQRimBDWvK53iED+P5FCAPhtjpPDVz5Sqdq0HsJP/2 NYU2OFgdeMz0Gkh/gACRUbbswPhwIOyHCZ/SxUuzlYPQKPd+hRFsmPcx9NO5oVaA1VO1 GcZS0V4fiqFIQ1NeaaNpogFoykL8D2rNv6/T7Rugzj6z9AGRROiXTVpJ5RY8pC4Ozx4T Q1cFonRiIpuA5xKG86rNVp1FrN+DwAhE7HuKNPLVaPMpebRZVlaXYcW9nXIxQVUt7c6I aGhM4qb87vYX54vOsPCMTD3jKk5mPxorIzfntWmUh2Br43tqscL0WoCKAPCpcUZ7Fklx iyjw== MIME-Version: 1.0 X-Received: by 10.152.120.228 with SMTP id lf4mr2433950lab.44.1382032326423; Thu, 17 Oct 2013 10:52:06 -0700 (PDT) Received: by 10.112.148.138 with HTTP; Thu, 17 Oct 2013 10:52:06 -0700 (PDT) In-Reply-To: <526022E1.1040406@gmail.com> References: <525C631E.1050008@gmail.com> <1381853515.3980.195.camel@guybrush> <526002B4.9010808@gmail.com> <526022E1.1040406@gmail.com> Date: Thu, 17 Oct 2013 10:52:06 -0700 Message-ID: To: Rowan Collins Cc: PHP Internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] Proposal to deprecate create_function() From: pierre.php@gmail.com (Pierre Joye) On Thu, Oct 17, 2013 at 10:48 AM, Rowan Collins wrote: > On 17/10/2013 16:47, Pierre Joye wrote: >> >> On Thu, Oct 17, 2013 at 8:31 AM, Rowan Collins >> wrote: >>> >>> Yes, I agree that there is no trvial solution which is 100% feature (and >>> bug) compatible with create_function(). However, I think the more important >>> question is whether there are any particular *use cases* which can't be >>> easily migrated to a different mechanism. >> >> That's the actual question, why should they? >> >>> My gut feel is that at least 95% of uses of create_function are to create >>> dynamic callbacks for usort, preg_replace_callback, array_filter, etc. >>> For >>> these uses, the implementation as an eval() is a liability, and >>> reimplementing with real closures is trivial (assuming no need to run on >>> <=5.2). >> >> Yes, as many other new features allow cleaner codes. However I do not >> see this case as good enough to add more deprecated notices to >> perfectly valid codes. > > > I guess to me it seems much the same as deprecating the /e modifier in > preg_replace: code using it right now largely works, but it presents a > security risk that many users probably don't appreciate. > > I wasn't subscribed when that was being discussed, so if there are points > from that discussion which would be pertinent here, I'd welcome > links/summaries. > > The only real difference I can see with create_function is that it is/was > more widely used; is that your concern, or do you see a fundamental > difference between the two situations? I do. create_function is used for many very valid use cases, safely, much more than /e ever was (and its security impact was much bigger). Deprecating it does not help us nor our users at this stage. Cheers, -- Pierre @pierrejoye | http://www.libgd.org