Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:80296 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 37381 invoked from network); 9 Jan 2015 02:58:37 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Jan 2015 02:58:37 -0000 Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.175 as permitted sender) X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 209.85.217.175 mail-lb0-f175.google.com Received: from [209.85.217.175] ([209.85.217.175:54536] helo=mail-lb0-f175.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 32/C3-14400-BD34FA45 for ; Thu, 08 Jan 2015 21:58:36 -0500 Received: by mail-lb0-f175.google.com with SMTP id z11so6129356lbi.6 for ; Thu, 08 Jan 2015 18:58:32 -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:content-transfer-encoding; bh=ZdNApudsnlj0bMlsEBfLlYfULCqXpS35/netagvi3K0=; b=ln3W2A178sRqzDX61p+5MEoirnStCA6CXh+ROoiOXTQATEFTXeHwahqFed1rjwcaZI XYtwu7z5GkCpw3qBj+MRF1+kgiGxkT0r4xmuD9m17CuMKzJuaDl/cNPDSASDKWNmUxop lXeCndUMNT/XQ8BRQEqACQuoqMkGXz5U/e8tChniyxWwvwXpHC6Z7UZekTzG/OiUDXvw qlgleW+WurkrZTudMMrW6Vs6UmRfrvLaAuCF+fSDwoRSY47Qx6/A0skJ3NQktAEb699B 9htMHaZloNmR0Ff53YU87Oz+TEL3Sivu857CmhrhA57e4xFtGI0v9tOf03/HqEgxyDmY IHTg== MIME-Version: 1.0 X-Received: by 10.152.115.146 with SMTP id jo18mr19271817lab.9.1420772312698; Thu, 08 Jan 2015 18:58:32 -0800 (PST) Received: by 10.112.154.133 with HTTP; Thu, 8 Jan 2015 18:58:32 -0800 (PST) In-Reply-To: <007901d02bb4$f9ccca80$ed665f80$@tekwire.net> References: <54AAF98B.4020709@gmail.com> <001b01d029bb$fa687fc0$ef397f40$@tekwire.net> <31A3F47C-0C5B-46E0-8B34-2105F467FDB3@fredemmott.co.uk> <007901d02bb4$f9ccca80$ed665f80$@tekwire.net> Date: Thu, 8 Jan 2015 18:58:32 -0800 Message-ID: To: =?UTF-8?Q?Fran=C3=A7ois_Laupretre?= Cc: Fred Emmott , Derick Rethans , PHP internals , Sara Golemon , Stanislav Malyshev , Benjamin Eberlei Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [RFC] Extension Prepend Files From: pierre.php@gmail.com (Pierre Joye) On Thu, Jan 8, 2015 at 6:35 PM, Fran=C3=A7ois Laupretre wrote: >> De : Pierre Joye [mailto:pierre.php@gmail.com] >> >> > We solved some of the other problems by only allowing definitions, no >> side-effects - classes, constants, namespaces etc. We do not allow code >> outside of a function body here. >> >> Yes, we will have to do that, no matter what we choose. I am however >> not sure how to do it with the current engine design. Using >> zend_compile (or a derived implementation) may help. > > Is there a technical problem with code located outside of definitions, or= is it just a convention (PSR already contains this rule) ? I understand th= e problems it poses in HHVM, but I don't see why we should check that with = the engine as it is structured now. Even if we can detect such questionable= usage (and we can detect it quite easily just using tokenizer output), IMO= , we are not responsible of what developers put in their scripts. I was too vague. If some code is loaded and part of it will be always executed even if not used at all in a request, this will have side effects. Also besides the impact of having code being ran on each request, I do not think it is good idea to being to have top context running code, at all :) Cheers, --=20 Pierre @pierrejoye | http://www.libgd.org