Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108323 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 96534 invoked from network); 29 Jan 2020 22:01:38 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 29 Jan 2020 22:01:38 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id CC192180531 for ; Wed, 29 Jan 2020 12:12:20 -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=-0.2 required=5.0 tests=BAYES_20,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, 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-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) (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 ; Wed, 29 Jan 2020 12:12:20 -0800 (PST) Received: by mail-wr1-f42.google.com with SMTP id g17so1063146wro.2 for ; Wed, 29 Jan 2020 12:12:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=vQ8GF+fzS+uy6dGr87dUZKXkGJK/GouJY35bZpG1tlE=; b=vHgiMcN6AC9utkZPAxnj2uz6U1Xlbmc9oYHSPaJUcdem13jc0Cwg1nxQ0P3NURz4Rt 4D0B+0PEQ56YePSq+kCS10hTokFYdmEmxq2IeKjkXx5shL55cQuv5NnlsmmZbPmJH74j DeaV/QhbpsD2HdWZtCHz2sjIGcfH8XPmkUkmVZvZOHLWmblCoxxVg6rxS5lL0o79bRtq 6dg3RlSqAU4kyqkeqQVrziTJj+BW8pDCx/5y1jTFuxexfq2oVleyXIMgtQ1Qlo+V0oD/ x2QNT849hyEpfCopOeqHFSApP/0csKRcGmJSkxMymjl+0ZY6jV5ynCfgXbCOSMINqbeb bFpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=vQ8GF+fzS+uy6dGr87dUZKXkGJK/GouJY35bZpG1tlE=; b=l2rqd1+CndigP0zLT/7aFgY+MirgnPNh+czhOlnHR84CHDl+1tXjBWXa+28XIhtTeS teldD0CwF4f3vSte68wwicR7Zsva+qjzRO3zuiXmwsvLOlDgInLQvr3AWGJ+0gUSROP4 NJ6kG0cA+BqMnv3LMD3HxmFgqE8hqIjkbfn1uDa/sFtibMWyRHdVz2G+UtNUPm2kLNfk hqkl+PGSS02YaByFda/mc9u7cV+hhkikDHixpEU0i5C8g7ixhb/bn3Mmtge/VUjFltvC q8GhH6/Cje/4gMiXopm5iMzw+uxB+NYAXE6lbVA1YUy0Vh6EJw8QL90bvqvkMgOeotnX 0hnQ== X-Gm-Message-State: APjAAAXlQ/vt0N+4cyoPBBdNqsItG4wgu39xC3weFQk9upJ+J4dI/iVH r2KG9gB9ao00AESdIzz9Ros= X-Google-Smtp-Source: APXvYqyuWoY73W9mbma31iE7zfwtGxS5cdA3H3A/zX0DlhEG4v2yv5w2tNgbxfinrh3KZEIMuNDn8w== X-Received: by 2002:adf:f64b:: with SMTP id x11mr524004wrp.355.1580328739149; Wed, 29 Jan 2020 12:12:19 -0800 (PST) Received: from [192.168.0.63] (84-75-30-51.dclient.hispeed.ch. [84.75.30.51]) by smtp.gmail.com with ESMTPSA id y8sm3367432wma.10.2020.01.29.12.12.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Jan 2020 12:12:18 -0800 (PST) Message-ID: <244D810D-4C45-4D02-A0B7-E625090C19A9@gmail.com> Content-Type: multipart/alternative; boundary="Apple-Mail=_AABDE563-0572-454A-8243-EAF3BB78652C" Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.40.2.2.4\)) Date: Wed, 29 Jan 2020 21:12:17 +0100 In-Reply-To: Cc: Marco Pivetta , tyson andre , "internals@lists.php.net" To: bishop@php.net References: X-Mailer: Apple Mail (2.3608.40.2.2.4) Subject: Re: [PHP-DEV] [VOTE] declare(function_and_const_lookup='global') From: claude.pache@gmail.com (Claude Pache) --Apple-Mail=_AABDE563-0572-454A-8243-EAF3BB78652C Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > Le 29 janv. 2020 =C3=A0 19:42, Bishop Bettini a = =C3=A9crit : >=20 > Cons... have to enumerate everything, potentially lots of work to do = that > to update old code to use; edge cases I'm not thinking about. Not only it is much work (although it could be partially automated), but = it does not make much sense. I=E2=80=99ve taken a random file (~650 LoC) in the codebase I=E2=80=99m = working on. With `declare(strict_qualify=3D1)`, I would have to add: use function=20 array_filter , array_flip , array_key_exists , array_keys , array_push , array_unshift , compact , ctype_digit , idate , in_array , is_int , is_string , ksort , ob_get_clean , ob_start , preg_match , sprintf , strlen , strncmp , substr_count , trim , usort; I don=E2=80=99t see a clear advantage in declaring more than 20 global = functions in each and every of the hundreds of files of the = codebase=E2=80=94where it is evident that they are all global function = (no, I don=E2=80=99t have a namespaced version of `is_int()`). Also, I = think that there are better ways to discover if my colleague introduced = surreptitiously a `system()` call in the codebase. Some time ago, I=E2=80=99ve tried the alternative approach in two files: = adding a backslash before each and every global function (carefully = avoiding non-functions such as `isset()`, `empty()` and `list()`). Well, = it reminded me of the good old days when I used TeX intensively, but = objectively, it didn=E2=80=99t make the code more clear or more secure = (I=E2=80=99ve not tested its velocity, though). =E2=80=94Claude --Apple-Mail=_AABDE563-0572-454A-8243-EAF3BB78652C--