Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:70491 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 62861 invoked from network); 3 Dec 2013 13:01:06 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Dec 2013 13:01:06 -0000 Authentication-Results: pb1.pair.com smtp.mail=ellison.terry@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ellison.terry@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.176 as permitted sender) X-PHP-List-Original-Sender: ellison.terry@gmail.com X-Host-Fingerprint: 74.125.82.176 mail-we0-f176.google.com Received: from [74.125.82.176] ([74.125.82.176:36907] helo=mail-we0-f176.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F2/20-61528-016DD925 for ; Tue, 03 Dec 2013 08:01:05 -0500 Received: by mail-we0-f176.google.com with SMTP id w62so7784051wes.35 for ; Tue, 03 Dec 2013 05:01:02 -0800 (PST) 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; bh=cXlKTvaUJrUxQ8wIhcuYO8UVvx2u9PsykdZYUpWYEaA=; b=SdxZgN/hOQvjnZBtTdU5eZGBKcBPKcgJ7Hq1yMYSTYbIkXaCLX9mGJT6RQ97Dgqe4b t9Q2EquUUyEPAIg0Lxh4W19WedvHHsNi4zh9bCF1waQVQT3xzGyOWGFm+fyZ5ezr+Vql qzbM04CjQ7KBcjj97JpOr2WimkGF9tVg9huKgU7uOKwLNEdCCFml7V5YG97eVfkW4iQ4 xImPda6Gfn1FeI16BKlJ0KaUACW02KUpvnLjvmwtpuXWIKeP05k0R7ilO0ar3GBnR4wr HVxrkDq0QSgy3uRIWJkiEpPOyhzBawti9TqNfryN8Gg3ClcvITR6MNKDrK77HHmR76r3 Xxdw== X-Received: by 10.194.94.167 with SMTP id dd7mr7090923wjb.43.1386075662366; Tue, 03 Dec 2013 05:01:02 -0800 (PST) Received: from [192.168.0.15] (97e69817.skybroadband.com. [151.230.152.23]) by mx.google.com with ESMTPSA id bk7sm5259434wib.10.2013.12.03.05.01.01 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 03 Dec 2013 05:01:01 -0800 (PST) Message-ID: <529DD60C.30601@gmail.com> Date: Tue, 03 Dec 2013 13:01:00 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.1 MIME-Version: 1.0 To: Derick Rethans CC: PHP Internals References: <528CE64A.1020303@gmail.com> In-Reply-To: Content-Type: multipart/alternative; boundary="------------040607090000010602070409" Subject: Re: [PHP-DEV] Comments on non-unique naming convention for closures From: ellison.terry@gmail.com (Terry Ellison) --------------040607090000010602070409 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi Derick, > >> What I am suggesting is that this convention should be changed for something >> like "\0{closure}$name$ctime$index" or even just "\0{closure}$uuid" using the >> standard UUID algo. Reactions? Comments? > For Xdebug to show them in stack traces, and for profiling, I rewrite > them to: {closure:/path/to/closure-stack-trace.php:4-7} > Seehttps://github.com/xdebug/xdebug/blob/master/xdebug_stack.c#L909 Thanks for this. What you are rewriting here is the function name of the closure being executed and which is the backtrace. As I said in my O/P, the closure contains a deep copy of the magic-named version stored in the EG function table. The closure copy is always called {closure} at the moment, but the original version has this supposedly unique magic name that I now want to make unique. Hence we have two separate issues: * What do we name the zend_function structure in the closure object? As you suggest, it would make a lot of sense here to make this meaningful to the programmer so {closure::-} is a lot better than the current {closure}. Hoisting your approach into zend_closures.c would make a lot of sense. Note that this name doesn't need to be unique. * What do we call the template copy in the EG function table? This is never exposed to the programmer, so it's name is unimportant in these terms, but it should be unique for a given closure source. Regards Terry --------------040607090000010602070409--