Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:69663 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 80117 invoked from network); 18 Oct 2013 05:25:22 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Oct 2013 05:25:22 -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.215.53 as permitted sender) X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 209.85.215.53 mail-la0-f53.google.com Received: from [209.85.215.53] ([209.85.215.53:61814] helo=mail-la0-f53.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E9/D6-43111-F36C0625 for ; Fri, 18 Oct 2013 01:25:20 -0400 Received: by mail-la0-f53.google.com with SMTP id eo20so211721lab.40 for ; Thu, 17 Oct 2013 22:25:16 -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=YC9PN+NHKkYEUd0wigpk92ArgyfyO1oBolTQR8UZ24c=; b=I8ncd10ZoZJiIEkOM8/NdjoEQvLBravBn7Po/QLhFQsS6XWNc9CZrTAAc5/rSNU8T8 WYRXl5qpRN0isbtEOVyYy+4azVhIDUufhHqdwnq/X9QQ6NKCGvwopaLOb7762fZAZD6n cSLU1s7oXfYu2ZHYSn3JAiEaGaxUBBYHqzmHlEPK5kSlFaZBSRb44xf9weOr1lwKfmFv 6pLy42yH6riWHbgnOVLPvWBeQOewgTXgc3fhjn9T1I37uuNKVdrc49vx/iSvnSXefFG3 YfycAt1Ox8CHaVu2TDYfv9ImDNksIFmymOPXzqdc7eVawmzKazvi1dqLB3GoiQ/2maVc dddQ== MIME-Version: 1.0 X-Received: by 10.112.0.242 with SMTP id 18mr1080083lbh.18.1382073916166; Thu, 17 Oct 2013 22:25:16 -0700 (PDT) Received: by 10.112.148.138 with HTTP; Thu, 17 Oct 2013 22:25:16 -0700 (PDT) In-Reply-To: <5260550C.1040406@gmail.com> References: <525C631E.1050008@gmail.com> <1381853515.3980.195.camel@guybrush> <526002B4.9010808@gmail.com> <526022E1.1040406@gmail.com> <52602B7A.3080509@gmail.com> <5260550C.1040406@gmail.com> Date: Thu, 17 Oct 2013 22:25:16 -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 2:22 PM, Rowan Collins wrote: > On 17/10/2013 20:29, Pierre Joye wrote: >> >> On Thu, Oct 17, 2013 at 11:24 AM, Rowan Collins >> wrote: >>> >>> If create_function did not exist, would any of those use cases persuade >>> you that it should? >> >> Not with latest PHP releases, but that's the point: we try to keep BC. > > > Well, to an extent - it is not true that any PHP script which works in PHP > 5.2 will work in PHP 5.5, let alone work identically. For instance, > call-time pass-by-reference causes a fatal error in PHP >= 5.4; unlike calls > to create_function, it's tricky to search for code that used that, and to be > confident of the implications of changing it. Comparing a widely used feature, working well with something that never really worked (and why we have removed it) is hardly a good argument to remove create_function :-) > So it is not a case of "thou shalt not break BC", but a case of "how big a > BC break is this?" Obviously, there are other questions (e.g. challenging > the reasons *for* removing it), but I'd like to break this one apart a bit: It is, create_function works and is widely used. We can provide good/better documentation to inform our users about better, cleaner, sexier ways to achieve the same but deprecating it in a 5.x release is not going to work out well. > Q: Is it difficult to upgrade code to not use the feature? > A: For 95%+ of cases, my contention is that refactoring use of > create_function() to use closures is pretty trivial. A few cases which > explicitly used its quirks may need a wrapper around eval() etc. Nobody has > yet piped up with a use case which would rely on the harder-to-emulate > aspects of the current implementation. Code should not be updated in the 1st place unless there is a really critical issue, something we absolutely have to change. That's not the case here, we do not enforce good practices (or we could enforce so many other things in the language ;). Also I think we disagree on that, we discussed pretty much all points, let face it :). I have to suggest to create a RFC if you feel like it has to be deprecated and see what other developers want. Cheers, -- Pierre @pierrejoye | http://www.libgd.org