Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108312 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 81058 invoked from network); 29 Jan 2020 11:35:13 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 29 Jan 2020 11:35:13 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 909BA1804F2 for ; Wed, 29 Jan 2020 01:45:50 -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,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-il1-f172.google.com (mail-il1-f172.google.com [209.85.166.172]) (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 01:45:47 -0800 (PST) Received: by mail-il1-f172.google.com with SMTP id x2so9650897ila.9 for ; Wed, 29 Jan 2020 01:45:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=JIUUl01hifX/EbtUu/FPa91jw9KL8eq2lWDkdGsfnQU=; b=nX3ANBpOzhS+XHm0/CNz1KNTJTxT/djNIc8vGxiYcmKbdhDYIYtABrXZ9ZxJDyZ1CT 6mbTKeb8zNtM2kSYlQt7oy2XoJrDbu0cTrgU0OAazls56dhuSLFBhkvTL2kbzQVM75za OnNgNezwWaDqZME7/FmwI2a/2W+nTRqaQAO476Qy9TYsnL1LRu/pdyhuvKWQ/6w3P91q A/S280zh5yehH3m9V9s3fDypXwqgwWbhpqhvTJeUwf+lV0b33hW0LTnK2OeSTc280tjf MgI6OX58E9oa4PRSEc11qfl3532oWmbhUvT9oK2c3wlIIbh0Sk/Fe5dvI5W99cSpV290 EqVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=JIUUl01hifX/EbtUu/FPa91jw9KL8eq2lWDkdGsfnQU=; b=pVig2H/Tb/MWtbe47bDHAYKaqLJEc/xrY1wFE2T7gp1KxHzr5i72JK57jaxLHlu1tC FkfCb232NMJOlyWb/gl8zvt0/WB1SpoJBHjSX7SE7KcZduZO4KsATaT2GSaGzhuWV/1h +SaxvADO38hssGqR1tnCyYbgASdQvaDIggrCtD7pgmg0YaBb0Udws716x5SlaJnVWZAm yvA23TuelHVOrnNYyg9Rb7Cpca9jOJMvWCTY5Eesckqz4TCyIDMCxhGHG9GwHLfp5CEz iSRhCrWVUJqvaWSSrpepiJjBG5H+R9HqbWSWMphG71MaQCSb3EZ0y2GM6WeckgDWUg+N ZBNA== X-Gm-Message-State: APjAAAUW7lFUSE72ahyKGpUXoygfu6maI7naHP9b2b1XevuUi+Z7dYgv 6BYIcY5nOPK0xQacNSCHnQCSFjhxtFmCYojFHbI= X-Google-Smtp-Source: APXvYqwHxjHCj7MXgrFRUZAFs1Tn5MgoJWWpL6nQclHG9UR+qTMmnKD7I8MdhD4lr5U2orgh6liBYnt+BzlE3X2/Oj8= X-Received: by 2002:a92:9e0a:: with SMTP id q10mr24125095ili.194.1580291145206; Wed, 29 Jan 2020 01:45:45 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Wed, 29 Jan 2020 10:45:19 +0100 Message-ID: To: bishop@php.net Cc: tyson andre , "internals@lists.php.net" Content-Type: multipart/alternative; boundary="0000000000005a0dcc059d443430" Subject: Re: [PHP-DEV] [VOTE] declare(function_and_const_lookup='global') From: kjarli@gmail.com (Lynn) --0000000000005a0dcc059d443430 Content-Type: text/plain; charset="UTF-8" On Wed, Jan 29, 2020 at 9:55 AM Bishop Bettini wrote: > Notwithstanding the excellent work done in the PR, I lean toward a No vote. > > Suppose I'm presented with this diff (and only this diff): > > $a = array_diff($x, $y); > + if (count($a)) die('Unexpected differences'); > > Where does count come from? I can't tell from this diff. It could be local > to this namespace, or it could be global. In the current implementation, I > have to scroll to the top of the file, check for what namespace I am in, > and what use are made. In the proposed implementation, I have also to check > the top of the file, but now its for > "declare(function_and_cost_lookup='global')" and the presence (or not) of > "use function count". > > It's not clear to me this is an improvement over status quo. > > [...] > > What do you think? > Hi, I think that when we're at a point where developers start using existing core function names for custom functions and they start 'overriding' things, you already have this problem, regardless of this RFC. You already have to check whether or not the function was defined via a `use` statement on top. I don't think your example of the diff would have a difference between `use` and `declare` when it comes to reviewing. I would advice developers to avoid using core function names in namespaces for custom functions, as doing this would open up a whole different can of worms when it comes to developer experience. Regards, Lynn --0000000000005a0dcc059d443430--