Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:69568 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 85910 invoked from network); 15 Oct 2013 16:12:07 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Oct 2013 16:12:07 -0000 Authentication-Results: pb1.pair.com header.from=johannes@schlueters.de; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=johannes@schlueters.de; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain schlueters.de from 217.114.215.10 cause and error) X-PHP-List-Original-Sender: johannes@schlueters.de X-Host-Fingerprint: 217.114.215.10 mail.experimentalworks.net Received: from [217.114.215.10] ([217.114.215.10:49615] helo=mail.experimentalworks.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9B/E9-31591-6596D525 for ; Tue, 15 Oct 2013 12:12:07 -0400 Received: from [192.168.2.20] (host-188-174-198-11.customer.m-online.net [188.174.198.11]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: johannes@schlueters.de) by mail.experimentalworks.net (Postfix) with ESMTPSA id A7E2940659; Tue, 15 Oct 2013 18:12:16 +0200 (CEST) To: Rowan Collins Cc: PHP Internals In-Reply-To: <525C631E.1050008@gmail.com> References: <525C631E.1050008@gmail.com> Content-Type: text/plain; charset="UTF-8" Date: Tue, 15 Oct 2013 18:11:55 +0200 Message-ID: <1381853515.3980.195.camel@guybrush> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Proposal to deprecate create_function() From: johannes@schlueters.de (Johannes =?ISO-8859-1?Q?Schl=FCter?=) On Mon, 2013-10-14 at 22:33 +0100, Rowan Collins wrote: > I would like to propose that create_function() be officially deprecated, > to encourage people to use the much safer and more powerful anonymous > functions we've had since 5.3, and eventually allow this relic to be > removed from the language. 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. Emulating it with eval() is also complicated as it has this nice trick of creating function names which start with \0 and therefore don't appear in function lists. I don't think this is a commonly used feature, but when kicking create_function() we should not call closures+eval a full replacement. johannes