Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:91384 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 13006 invoked from network); 24 Feb 2016 23:19:19 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Feb 2016 23:19:19 -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.45 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.45 mail-wm0-f45.google.com Received: from [74.125.82.45] ([74.125.82.45:35524] helo=mail-wm0-f45.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4C/62-27730-67A3EC65 for ; Wed, 24 Feb 2016 18:19:19 -0500 Received: by mail-wm0-f45.google.com with SMTP id c200so4651794wme.0 for ; Wed, 24 Feb 2016 15:19:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:subject:to:references:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=BQg84lEg2tZsZwHNew1wzVh7SXnsGyZ90wiUw8skVbM=; b=A2nGW74u3xP98YeCTlX4jIWoL2381cP7cUAwzZMk8Pj4YetyK2cq+e+r7znVmCApvT pUMwMjdnxVaKe/jbkvJMvFItU0tW92FTG9WEdQr+MTGpZoFBRxTmRY1dt3IOlGHLx1LK yd21dAeHTisfKtIVRaEPxEZNEM/xucGQFyx8m1R3T35c8+fyjvEny/YLNgxTUUwozjRE vy/cnV+rtVmE6Qb7XLK0Shfgt0bEQ+7JKa/HTUy2tWspQTxzAHvzvoWkWnGFu6SCKLS2 JJbpPaewECkbidfBkqZ+rnLLuxdWR1h93PjZPvjObuc17fUIP9IpbNhVGlPTexpAwvb9 Aipw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:subject:to:references:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=BQg84lEg2tZsZwHNew1wzVh7SXnsGyZ90wiUw8skVbM=; b=XxFbLCeK7ngU6R9XySMMriloEjKLKz6R2hkBm1QHrg81iClAJkahK+irsQF9nehdOc 6/KfRTZRHfcIsVP1cUXOuD37dl74Ei2Cid/QSOP5d3thULmI2JgWcLNHuHYsmTV7t7/5 G0n7ohBC2qer5u5IMNuYhxBP1I9OPyJquzhEac2/2sgCUWbhCTaLOwy0hyThymmoq4BC cny4/9+A8QGnvnMs0QGfmygCKeJ2PRszeHghJVgnHl/Ldpt5dowSkBFVdrCo6mMBiZw+ MKsk2iUns76paW8B2HkP5sujaNgUSJeOFvQz6skQOXMlouTpL4DZsV+rO6IKOgiKKXrU UYKw== X-Gm-Message-State: AG10YOTyqhZf4JMd/qTiBB7xRZCSCuKrGFtGsEjnjKge3Mp05D8P0YlxLrSu0xni9FcuAg== X-Received: by 10.28.182.136 with SMTP id g130mr150447wmf.10.1456355956065; Wed, 24 Feb 2016 15:19:16 -0800 (PST) Received: from [192.168.1.189] ([95.148.161.211]) by smtp.googlemail.com with ESMTPSA id lc3sm5133386wjb.7.2016.02.24.15.19.14 for (version=TLSv1/SSLv3 cipher=OTHER); Wed, 24 Feb 2016 15:19:15 -0800 (PST) To: internals@lists.php.net References: <56C63A8A.3030809@gmail.com> <97CC6432-564B-4E28-B2DE-9C496FF1984D@zend.com> Message-ID: <56CE3A6E.2070205@gmail.com> Date: Wed, 24 Feb 2016 23:19:10 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <97CC6432-564B-4E28-B2DE-9C496FF1984D@zend.com> Content-Type: text/plain; charset=windows-1255; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Deprecations for PHP 7.1 From: rowan.collins@gmail.com (Rowan Collins) On 18/02/2016 22:45, Zeev Suraski wrote: >> I'm not sure about create_function() - while it is old, I don't see why >> we should break working code using it just because better option is >> available. > There's that, and there's the fact closures don't give you the same functionality - as Andrea pointed out. I think > deprecating it and forcing people to rewrite their code differently (either with eval or with closures) doesn't make > a whole lot of sense when create_function() works perfectly well. In terms of security risks, if you use it like you > use closures I don't think it's any riskier. If you need eval() for programmatically creating functions - it would obviously > be at the exact same risk levels. So we're left with marginal performance gains - as practically speaking you don't > typically create thousands of functions dynamically in a given request. If you do, chances are you've already > migrated to closures. Funnily enough, one of my first contributions to this list was to propose deprecating create_function: http://marc.info/?l=php-internals&m=138178645724006&w=2 The answers to my proposal were mixed, as they have been here: some agreed that it was ugly and a potential security problem if misused; some pointed out use cases which can't trivially be implemented with Closures, such as this: https://github.com/phpcr/phpcr-utils/blob/42db960a6c58dcc3a71c2e4770050cda36f17c5b/src/PHPCR/Util/Console/Command/NodesUpdateCommand.php#L68 In the end I dropped the idea on the grounds that a deprecation notice should have a clear migration path for all reasonable use cases, not just some of them. I tend to agree with Stas that deprecations need to be justified more strongly than a general desire for tidiness. As with "can we rename functions / fix argument order / etc", I wonder if there's scope for publishing an FAQ which, while not holding the force of Official Policy, is nonetheless endorsed as consensus to guide new contributions... Regards, -- Rowan Collins [IMSoP]