Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:69645 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 7021 invoked from network); 17 Oct 2013 17:48:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Oct 2013 17:48:28 -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.53 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.53 mail-wg0-f53.google.com Received: from [74.125.82.53] ([74.125.82.53:53052] helo=mail-wg0-f53.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5B/A3-12663-AE220625 for ; Thu, 17 Oct 2013 13:48:27 -0400 Received: by mail-wg0-f53.google.com with SMTP id y10so2668337wgg.20 for ; Thu, 17 Oct 2013 10:48:23 -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:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=n70B4Cio0MEJmdSOFiVJxrbaq8+nGXsDR9mZSUqT+iw=; b=L8PIkCpKfuB8+9iIewkzuMtPN4Crgb4suQghyTJNKFBnMMWD3751pGMf706higCBsy NYwCIz9+xejkq6DgQtDFw36brdDXDmK1gJomLViaYncciDmd9L2Izwe0FWq4fS0bkgsk 1JlFfNPcRd9xcmWsvTCsQTN6p5C7gs9SIx9N6PgI2oH0L4MPeeic6x7cRMmCoFYJQkTI FqC3XH0U2r+2ZfsXHpgWsNNTLl5PnPKWj7GZku5s42amYM19gAGBkCp4eNympJXfKU4e kE/jMAmlsmTMY0GesDuveTTdi3M7+BJu/8LQVtLiax5dvhVvD+u/3BuWTBzRXt/rDrXU z+1w== X-Received: by 10.180.219.33 with SMTP id pl1mr8073959wic.49.1382032103636; Thu, 17 Oct 2013 10:48:23 -0700 (PDT) Received: from [192.168.0.2] (cpc19-brig17-2-0-cust25.3-3.cable.virginmedia.com. [81.101.201.26]) by mx.google.com with ESMTPSA id ma3sm18568419wic.1.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 17 Oct 2013 10:48:23 -0700 (PDT) Message-ID: <526022E1.1040406@gmail.com> Date: Thu, 17 Oct 2013 18:48:17 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.0.1 MIME-Version: 1.0 To: Pierre Joye CC: PHP Internals References: <525C631E.1050008@gmail.com> <1381853515.3980.195.camel@guybrush> <526002B4.9010808@gmail.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Proposal to deprecate create_function() From: rowan.collins@gmail.com (Rowan Collins) 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? -- Rowan Collins [IMSoP]