Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:69636 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 89905 invoked from network); 17 Oct 2013 15:47:22 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Oct 2013 15:47: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.50 as permitted sender) X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 209.85.215.50 mail-la0-f50.google.com Received: from [209.85.215.50] ([209.85.215.50:47744] helo=mail-la0-f50.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9E/50-12663-88600625 for ; Thu, 17 Oct 2013 11:47:20 -0400 Received: by mail-la0-f50.google.com with SMTP id gx14so1957357lab.23 for ; Thu, 17 Oct 2013 08:47: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:content-transfer-encoding; bh=saRULIQI+wLhUze6ZNIG/qlBH2pNB7x93+g8dryii7k=; b=sNb7iIC4BvqLA6WDNH47O3yaSYfRVF+e0QJXxD2cuun3EUpdWr94RpSDkBhZDRF+kj 7nxt3llDaBWQaHDqvxZVOnKlAlvPysDG/xBoa++67mDDXDi0DDLsPaVfHyslFEXlq3Ae EsRMAF9CNAYACfAG1bGShuen1u9cJjXT/JAXGfPra9Ugk2YbB+MaRE4JeBiar2YureBa gFEDibzaHLB2NPTqHYQzESPfYYkUvIGV53/XshMtGjg2O+Q9z+PqqT6KPfmfF8BnyaA9 oBXP3dRrOi8kebfkMzVmx7VAje8FHBucyLvVxym7XZmJbVI/Xa+EsU9KV16wa77QfYim w3LA== MIME-Version: 1.0 X-Received: by 10.152.22.97 with SMTP id c1mr7332645laf.31.1382024836668; Thu, 17 Oct 2013 08:47:16 -0700 (PDT) Received: by 10.112.148.138 with HTTP; Thu, 17 Oct 2013 08:47:16 -0700 (PDT) In-Reply-To: <526002B4.9010808@gmail.com> References: <525C631E.1050008@gmail.com> <1381853515.3980.195.camel@guybrush> <526002B4.9010808@gmail.com> Date: Thu, 17 Oct 2013 08:47:16 -0700 Message-ID: To: Rowan Collins Cc: PHP Internals Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Proposal to deprecate create_function() From: pierre.php@gmail.com (Pierre Joye) On Thu, Oct 17, 2013 at 8:31 AM, Rowan Collins wr= ote: > On 15/10/2013 17:11, Johannes Schl=C3=BCter wrote: >> >> In general: Getting rid of it is good. But mind that closures are no >> full replacement as with create_function() the code can be created on >> the fly. > > > Yes, I agree that there is no trvial solution which is 100% feature (and > bug) compatible with create_function(). However, I think the more importa= nt > 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. Fo= r > these uses, the implementation as an eval() is a liability, and > reimplementing with real closures is trivial (assuming no need to run on > <=3D5.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. Cheers, --=20 Pierre @pierrejoye | http://www.libgd.org