Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:111388 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 10914 invoked from network); 9 Aug 2020 12:39:18 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 9 Aug 2020 12:39:18 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id E59261804DB for ; Sun, 9 Aug 2020 04:38:09 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sun, 9 Aug 2020 04:38:09 -0700 (PDT) Received: by mail-wr1-f46.google.com with SMTP id f1so5626444wro.2 for ; Sun, 09 Aug 2020 04:38:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=DZIkpOSWk7LLA7ebQL//Y16UOgp1/NBDpy96r3IxkIw=; b=BPSieyqqfYj/wiZ9ljX527Rjonn9QCZYA7ty4XvbbGWGsGU3udCJW8cN+0TTPC5uYl RIS8Wbx9XqtRQOeV2O1oPjWjJHxkijbl3xD99jJVXHQ3wXI36iZWUJ8fXsRYzGCCo3TY DuwLkxj9JTLEGlLMJANeT1IzzpfteKdeQti5ukuhk/j9URgU8CcGXyH8SjKMXkx0ji8u C3errOPD9Bo3dpPA4I8RJ8JmliuFDAfwD+20cq820O5SLBE4UOPEYcUb5Uh97KjRUiVC qHAh9ze4I5cHUUftCvHAfiHYYfV42Gj21BRvCNZfsbqiSPnRxBBk+3hZYSxb4h0TwcAE mh8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=DZIkpOSWk7LLA7ebQL//Y16UOgp1/NBDpy96r3IxkIw=; b=nSxfzdz4iiGsVpi7waN7oNRps48/7yp4Y7vFGSBzfkmT4LPmu/AlPlKuxuHQ/fdbL1 T5SXcV+bzGkTRGAcBNlTz+Ph1b5/4WeAtRbe8UBLmPfwIJoCET+VdQGDkk3Sp2vFwPig Q6hqRRvwHxzS7Bp38H3qllt9+V+fkB2d9VF8h0onZDbE9oq0c/EPeNBEuVlvbxSvXxmy V5TAzHmMZUUrqB+RSgacvH+L77wG8ThY7JcLaJAPKPUxHwDHZuJVkAwLaybOHgjga29R km0stM2hlb/iMc3nf8ETE7/uvTGi/Fue+V7t+3bejsiBt9Ru7AojQofDzs+jd6jCxjdn iAEw== X-Gm-Message-State: AOAM533AIlnWbXkKoRBu8nAyJYUeItxuoFh+/DB/Z+CSjDsvvEvtw4Nq 1QOxxgGM9CdDw6Tgm8vAbWCUz2Vq X-Google-Smtp-Source: ABdhPJw6DPO1ImI30thodkDRAV5qWlnPH+97icCm5hksEgOE2X96lYnhTrGd40NHhfT5A/wQOVnIrA== X-Received: by 2002:a5d:6748:: with SMTP id l8mr21171512wrw.358.1596973084055; Sun, 09 Aug 2020 04:38:04 -0700 (PDT) Received: from [192.168.0.22] (cpc84253-brig22-2-0-cust114.3-3.cable.virginm.net. [81.108.141.115]) by smtp.googlemail.com with ESMTPSA id v67sm18037086wma.46.2020.08.09.04.38.03 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 09 Aug 2020 04:38:03 -0700 (PDT) To: internals@lists.php.net References: <173d2736435.eeebc066559719.6668730031195302987@manuelcanga.dev> Message-ID: Date: Sun, 9 Aug 2020 12:38:03 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <173d2736435.eeebc066559719.6668730031195302987@manuelcanga.dev> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB Subject: Re: [PHP-DEV] [RFC] Import of variables From: rowan.collins@gmail.com (Rowan Tommins) On 09/08/2020 10:01, Manuel Canga wrote: > Hi Internals, > > I'd like to open up a discussion around the implementation of a new > functionality: 'import of variables'. > > This functionality would allow to create a new 'use vars' keyword in order to can use( or cannot use ) global variables in local scope( of current file ). Right now, PHP has no notion of "file scope", and making that the _default_ would be a huge compatibility break. The "use vars none" variant that opts _out_ of the global scope might be possible, but at that point, you can just use the common JS trick of wrapping your code in a function and immediately running it: