Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:73016 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 73360 invoked from network); 8 Mar 2014 23:33:44 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Mar 2014 23:33:44 -0000 Authentication-Results: pb1.pair.com header.from=marco@m-s-d.eu; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=marco@m-s-d.eu; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain m-s-d.eu from 209.85.213.180 cause and error) X-PHP-List-Original-Sender: marco@m-s-d.eu X-Host-Fingerprint: 209.85.213.180 mail-ig0-f180.google.com Received: from [209.85.213.180] ([209.85.213.180:59264] helo=mail-ig0-f180.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DD/64-44862-6D8AB135 for ; Sat, 08 Mar 2014 18:33:43 -0500 Received: by mail-ig0-f180.google.com with SMTP id hl1so5192980igb.1 for ; Sat, 08 Mar 2014 15:33:40 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=a/jU+riFgqWEZIOVa00qL9DLO07g0l4KluHs5PhNJq4=; b=XbqU+exKNtCnMCTlRZvdNZBi13uAAZw4nz9ttgcLSYbbQi57gBdZyZOjIu46bfkB3o JyXTHzTDd2sZMf9glOFAqlmpFrYXRv6SxErrKNNXCMpKxFBfoKuZRPBMY9aPeRdBfGi9 YPz1+Jgp26b+1AK6uQvsfkwVh165tiIno9Ms37ZcGPJpWwitutdEy9m8G/hXrs4IoODb 6C0KWdKIkX4wmCuYNQiXUp8+Eamo4J/0Kk7jvrLi8jp2uaAheUzr7P/1/SLdKgBBRgBZ gW3VC2RogNDg1m7iAHdUWJdf5QODR8MZoCPFMf11BM/jQXrbkWhOsg/v0ceyCI/Bu7y1 Z7Fg== X-Gm-Message-State: ALoCoQkMxotzOjbG6axGuJxJOPVkPf2rDugySHwQi8bCbsukk1ubpgSTeDn+CZxCscmc2Dt3EHC3 MIME-Version: 1.0 X-Received: by 10.50.136.162 with SMTP id qb2mr10753613igb.11.1394321619791; Sat, 08 Mar 2014 15:33:39 -0800 (PST) Sender: marco@m-s-d.eu Received: by 10.64.165.166 with HTTP; Sat, 8 Mar 2014 15:33:39 -0800 (PST) X-Originating-IP: [84.153.66.192] In-Reply-To: References: <03CFE6C6-0742-4928-BD2B-E9C920E9246A@ajf.me> <29BDF40C-562D-4943-877B-70701335D3AA@ajf.me> Date: Sun, 9 Mar 2014 00:33:39 +0100 X-Google-Sender-Auth: tW9JZCtAfdctE340Dxut_9KrWWU Message-ID: To: Chris Wright Cc: Andrea Faulds , internals Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Idea: ifdef-like feature to ease userland BC From: marco+php@m-s-d.eu (Marco Schuster) Hi Chris, On Sun, Mar 9, 2014 at 12:01 AM, Chris Wright wrote: > I'm not necessarily in favour of this idea as a core feature but to > give a more practical example of how this could be useful: generators > can give considerable efficiency gains where previously more resources > would have been consumed by a process yielding values over time. > Before 5.5, generator code would cause a parse error. > [...] > Another advantage for performance-minded people is that a > pre-processor is a one-shot deal, whereas runtime checks are > potentially performed a few hundred times a second with the exact same > result every time for ever more. > > **However** the thought occurs that, while potentially useful, a > pre-processor of this nature could easily be done with a userland > implementation, a composer dependency and a composer > after-install/after-update script... Yep, I had code like yours in mind when asking. One problem of doing it with Composer, for example, is that it is not compatible with stuff like WordPress plugins - I personally would really like to be able to use "modern" features while still allowing for all those myriads of version combinations provided by web hosts. One idea to do this with a "polyfill" could be (expensive) preprocessing with file_get_contents() and eval(), but I think that step would offset any performance gains by using goto, generators etc. Marco --=20 Marco Schuster IT-Beratung, Web Development Bl=C3=BCtenstr. 23 80799 M=C3=BCnchen