Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108278 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 11498 invoked from network); 27 Jan 2020 21:39:45 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 27 Jan 2020 21:39:45 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 52AE51804AC for ; Mon, 27 Jan 2020 11:49:58 -0800 (PST) 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-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (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 ; Mon, 27 Jan 2020 11:49:57 -0800 (PST) Received: by mail-wm1-f41.google.com with SMTP id c84so8433027wme.4 for ; Mon, 27 Jan 2020 11:49:57 -0800 (PST) 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=AZcu1KgibpO+JID9CSFq817IzSDviCGipJBFvDHn0uE=; b=lhEMRjEpN9/ZJFk8/FufJULRuoyidsi5UfRWdQ0soYNrLyLt/VjwwLOIp4b9CM4JqJ zxV+8LmeH/k9pF0yxb6DYvYgw8UY+541Y52tUEMVfE3NyVVp2rcd67MiYSUS7LJq6OHg 2HZ6tXELo8XeqdD1HJMaw9jkDKRndLgNjXyHaouOJ6nPxcTCtbtd+aowtxb2zl/4SNIH NerMZlCc1Yb0pYLlDnz6IIgMIRyvnqUyUjhZM7rza+yFfR10YkUfKLqEFDW8QfePJRt5 KyLReDTbnx3HVG/VgcXRGaDpxIewAtgoZpFdZp3D4S5brY2lOkFdyHBMT37UVe88RL5V rC/g== 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=AZcu1KgibpO+JID9CSFq817IzSDviCGipJBFvDHn0uE=; b=eGQPqXWcvhCK4EKT5Mv770IpYpadq/eDBbnOXO1BVUI1XF+TBNyaOlEQdF9g+UhFfa axqeXeTCSMgtwspfNuTT3paOEJeRJr26tyquoUDx7H5Y5tV2s80GAU/eij4uwavbY+QG GO1mGIRaw/YvdnjfSD76sbTlDCMW2tigzs9uRaQcSTdj1tWK5aiOk1qlF0E97+6Y9W8G Fgg3whshc+4fqfKPONGX1C3Ag/ME4pBfLTXvo/7mrO3PYDRUbjVWKuTZmsZyf5RHaD6O B/+lRzbzDPSoZ7cr1YUvIWgaPNuOBYyw3h2eWtnOh7LMiPWaXSoNglSRYFC2nAjGujVb tCXg== X-Gm-Message-State: APjAAAWosgH2Qhm65NVv7wff8ih2EUUMRjQw1ojWIm19WCBvQj3SgNqX q9n4u8JmFvmNnpnhi1SYFHG2SB3w X-Google-Smtp-Source: APXvYqxn+mUG6ZIqwC65YeHw9PfYNZW+6J+H1HBHlR1K9Agh3m+uPIs+A7rD3etV9eFJwEDFr7FL2Q== X-Received: by 2002:a7b:c759:: with SMTP id w25mr271265wmk.15.1580154595638; Mon, 27 Jan 2020 11:49:55 -0800 (PST) Received: from [192.168.0.14] (cpc84253-brig22-2-0-cust114.3-3.cable.virginm.net. [81.108.141.115]) by smtp.googlemail.com with ESMTPSA id n12sm10620052wmi.18.2020.01.27.11.49.54 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 27 Jan 2020 11:49:54 -0800 (PST) To: internals@lists.php.net References: Message-ID: Date: Mon, 27 Jan 2020 19:49:52 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB Subject: Re: [PHP-DEV] [RFC] "use global functions/consts" statement From: rowan.collins@gmail.com (Rowan Tommins) On 27/01/2020 14:43, tyson andre wrote: > I'd rather have that done when the future change of defaults is being proposed. > Supporting 'fallback' might cause confusion and extra work if the name resolution defaults ever change in a different way. > At the point where they do change, we either do or don't want a way to support the old 'fallback', > but we will want to support the new 'default'. I think we should aim for forwards-compatibility as well as backwards-compatibility, and that means being able to positively assert that the current behaviour should continue for as long as the engine supports it. If I add declare(function_and_const_lookup='default') at the top of my file, I don't get that guarantee, because the meaning of 'default' might change. Imagine this scenario: * PHP 8 introduces the declare with only 'global' and 'default' options allowed, as proposed. * PHP 9 makes 'default' a synonym for 'global', because it's now the default, and adds a new 'fallback' option * I have an application that uses the fallback mode I can either: * Rewrite every file in my application prior to upgrading, and add a declare for 'global' mode to work in PHP 8, even though it will be redundant on PHP 9 * Add a declare for 'fallback' mode, meaning my code works on PHP 9 without other changes, but can no longer compile on PHP 8 That doesn't mean we have to support both modes forever - we can make 'fallback' mode immediately error, which is still useful feedback for anyone who added it to their code. Explicitly selecting a default for some value is useful when any value would actually be acceptable, and you want to delegate the choice of value to someone else. That's how PASSWORD_DEFAULT works, for instance - it means "please select a sane algorithm based on the current state of the world". I don't think that applies here - any file will have been written with one set of rules in mind, so "use whichever namespace rules are currently recommended" doesn't really make sense as an option IMO. Regards, -- Rowan Tommins (né Collins) [IMSoP]