Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:80747 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 8810 invoked from network); 18 Jan 2015 16:50:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Jan 2015 16:50:39 -0000 Authentication-Results: pb1.pair.com header.from=nikita.ppv@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.178 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 74.125.82.178 mail-we0-f178.google.com Received: from [74.125.82.178] ([74.125.82.178:35302] helo=mail-we0-f178.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 99/FE-18613-E54EBB45 for ; Sun, 18 Jan 2015 11:50:38 -0500 Received: by mail-we0-f178.google.com with SMTP id p10so27648386wes.9 for ; Sun, 18 Jan 2015 08:50:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=Aansb+kfw221x/0mPKH6Q0PfnW6/9soWlkxZp/DdhG4=; b=AXHZG9IlWYd6ZBeQ0UO0RpatnM8ruo+pVNROZIDhosWgh9frQBRS5IQSsCh94Yd1Uf LCYRyEMTGeN55Cc9cZbXM37wtzXtlloUlpmXUU+CzFuvnilx9WWewf4AokJ5dPSMJoSj X5MvBApizVUowVC9J+7UUKINSwqggABKFmuMjrMb3nnUKnuLwD+a+tMamAroPSdM6X8Y zW4brrgbPG4So1Q6RRf93tDgQGm2ODje1o72asnJe+aFHKTV12Sh3EqTeKUL+eBBi6RE it0sZgGT13B1eqr1eBaLeoQbJg3zrFt2UiJkiFmSWwVJ2XUzXKTUa0c5xe0ejSgfoOBZ 4N5Q== MIME-Version: 1.0 X-Received: by 10.180.211.195 with SMTP id ne3mr26332257wic.52.1421599833690; Sun, 18 Jan 2015 08:50:33 -0800 (PST) Received: by 10.27.10.138 with HTTP; Sun, 18 Jan 2015 08:50:33 -0800 (PST) In-Reply-To: References: Date: Sun, 18 Jan 2015 17:50:33 +0100 Message-ID: To: Sara Golemon Cc: PHP internals Content-Type: multipart/alternative; boundary=001a11c34850199a0e050cf00101 Subject: Re: [PHP-DEV] Mind if I hook the compiler? From: nikita.ppv@gmail.com (Nikita Popov) --001a11c34850199a0e050cf00101 Content-Type: text/plain; charset=UTF-8 On Sun, Jan 18, 2015 at 3:58 AM, Sara Golemon wrote: > https://github.com/php/php-src/pull/1004 > > Wondering if anyone has an objection to me merging this. It just > offers extensions a chance to alter the AST prior to bytecode > emission. Mostly for evil things, but potentially for 3rd-party > optimizers or whatevs. Does it need an RFC? The very minor > indirection cost hides itself behind OpCache, so it should harm > anything... > Totally okay with making that hookable, but not sure if compile_top_stmt is the best place to do that, at least in the form implemented in the PR. Assuming that you want to implement a preprocessing pass on the AST the fast that zend_compile_top_stmt is called recursively might be somewhat inconvenient. Maybe compile_top_stmt should at least also call compile_top_stmt instead of zend_compile_top_stmt? Nikita --001a11c34850199a0e050cf00101--