Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:91500 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 21263 invoked from network); 4 Mar 2016 13:53:15 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Mar 2016 13:53:15 -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:36978] helo=mail.experimentalworks.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 41/A0-15711-94399D65 for ; Fri, 04 Mar 2016 08:53:14 -0500 Received: by mail.experimentalworks.net (Postfix, from userid 1003) id 7035942DFE; Fri, 4 Mar 2016 14:53:09 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on km31408.keymachine.de X-Spam-Level: X-Spam-Status: No, score=-1.0 required=4.0 tests=ALL_TRUSTED autolearn=unavailable autolearn_force=no version=3.4.0 X-Spam-HAM-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP Received: from [192.168.2.34] (ppp-93-104-2-131.dynamic.mnet-online.de [93.104.2.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: johannes@schlueters.de) by mail.experimentalworks.net (Postfix) with ESMTPSA id B9AD242DF4; Fri, 4 Mar 2016 14:53:07 +0100 (CET) Message-ID: <1457099585.14527.13.camel@kuechenschabe> To: Andrea Faulds Cc: internals@lists.php.net Date: Fri, 04 Mar 2016 14:53:05 +0100 In-Reply-To: <24.F3.62769.A4226C65@pb1.pair.com> References: <24.F3.62769.A4226C65@pb1.pair.com> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-56Dx0cY7LxsNr1YVHjdO" X-Mailer: Evolution 3.10.4-0ubuntu2 Mime-Version: 1.0 Subject: Re: [PHP-DEV] Re: [RFC] Deprecations for PHP 7.1 From: johannes@schlueters.de (Johannes =?ISO-8859-1?Q?Schl=FCter?=) --=-56Dx0cY7LxsNr1YVHjdO Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, 2016-02-18 at 19:57 +0000, Andrea Faulds wrote: > I've actually used create_function on occasion for programmatically=20 > generating functions (in particular to create a function for each PHP=20 > operator), but it's trivially polyfillable, and it'd be better if > people=20 > were implementing it themselves (and thus knowing it's based on > eval())=20 > than using it directly without this knowledge. Just as a detail: You can't create a 100% compatible polyfill to create_function(). create_function() names functions starting with \0. Functions starting with \0 are hidden from get_defined_functions() and possibly other places. php > echo sizeof(get_defined_functions()['user']); 0 php > create_function('', ''); php > echo sizeof(get_defined_functions()['user']); 0 php > eval('function foo() {}'); php > echo sizeof(get_defined_functions()['user']); 1 johannes --=-56Dx0cY7LxsNr1YVHjdO Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQEcBAABAgAGBQJW2ZNBAAoJEH3sTmn8nIPXuy8IAKZGIYy7ds1PaRLpz+isSEn2 UuEFVKaE2DChrV9lXxeEa1xaTQRwb5pw3LVRIH9efqWb21ZlOBKjv9phISppAq7w BOSY4wFOX0dOTn0hdHA/QAKwXLEe6qLu+VGY0pDMDycruDHP7wMOQmMkSQkLo2aR 6FQ1SSfzsV4lVAH78yUvxZyGrsS26dW+8J0N9nko9Joot+vls1oI63vKKIwFp00i qgJnTpsMx9w62M3cjqy2Tl9RBE7WnyD11f/CYNjO8OAd2fdSeBAS7AJ+eVdc69Th WbRBdQsduILuNpcVqJ7u3bIqoN2wTIcLvYwlRE2dWEk4lKoEZxjX+yxpjkBICT0= =klZL -----END PGP SIGNATURE----- --=-56Dx0cY7LxsNr1YVHjdO--