Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:124766 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id 713EB1A00B7 for ; Mon, 5 Aug 2024 13:15:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1722863860; bh=5pZ23G+BrVStqAFXgwLkZ/Cz+2uDRe5V4zs9oOnUIm0=; h=References:In-Reply-To:From:Date:Subject:To:From; b=YI0nuEcx8W5QkIahvdkSlHeOA1Wql8htITeaxLoH63wkSWrwrqoxArFk+XRjL55z7 IPjUywIHnzGYwvt9fsSgYRyJ/ed/ts4f6df51A9OLKmaR3lbSSnKUXx22h30l2Fps0 sNkk+aWPtWJvXJo9cR05MxrnDaujsAi9LFDmuYbQ5dDwTeLrXo5vsh9E4ww64oI/yT 3PVpDYCUkHsT6u7GwyIQx0HyXsSaviI3EZYu3wxeKuBIdEhZ8BQb1PumsA5t8BpBgU +W6EAfdLyJC5oZyB79aYWq8KH+ZrgVH99qRRJJPVO4KCRAvu81y0KG4fz5fTvb7IjO ZA/gllEW5K8gA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 4655218037E for ; Mon, 5 Aug 2024 13:17:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-qv1-f48.google.com (mail-qv1-f48.google.com [209.85.219.48]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 5 Aug 2024 13:17:38 +0000 (UTC) Received: by mail-qv1-f48.google.com with SMTP id 6a1803df08f44-6b7a0ef0dfcso58638156d6.1 for ; Mon, 05 Aug 2024 06:15:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722863757; x=1723468557; darn=lists.php.net; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=5pZ23G+BrVStqAFXgwLkZ/Cz+2uDRe5V4zs9oOnUIm0=; b=KiFKw/jP8jmdBfywt+bEAVmWM1SiXhR3a0an9Iwacmiv/PNBpad7gnTe4m8txEe6Pu v0B6lmGxL2JQsBwrTP1iJSua62p1VX3Z4feMTqjE3yQ0BqRU/EhsgxktwN7FbWn8VMVf amINteGzIsqF6W8nT5NoDeGn1iJB6hcvOE66kxrt5lRczXy1WpwM5ToIH6m53c9zz46m uL6DL2q6+1Ca4v3qXThmBNfUc7Hzx158jGwgpkSbT/OJ9YDvW4vWqI+Xxwwct5sZw75/ 69oUAyYSOPmvd1dzfZhVccVvkBcqgsE5Nd93/O8SrL9NvL0DdaDUnWdX2qXSA6OpWWNa dpLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722863757; x=1723468557; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5pZ23G+BrVStqAFXgwLkZ/Cz+2uDRe5V4zs9oOnUIm0=; b=sioDoW4N7hpvS6entScdqS8KwgKPe8kbvSRGky4DvlF4fSUV8Lyl3HZ7Tkrtw92L1b XJ6ERaOoK5fHW/2Q7xgzxSBht7N9RnUHJdeKxXIyJFLBuVaaSk1elLK/rZX93F4ey17C 0E9SE9ESy8bRmcY/waR44sWbca0lkgyooMDiTRe8KFcd990PblHtYgn71aqMXRaKX1VZ 8LYYt07RwOU7PLXN59+vkSqKx31tOKOorl/BH6tYHDbGMawd4Qe5Yj2YU4xtGnFCVZ0J pq8i07ACK6Ix2K2DQbbyb4suLO6lbSiwnNC1KBLROsE5fNuL1nKP4XpCk1DAkbBUgXSg tLvA== X-Gm-Message-State: AOJu0YwOT8d9vc186OsmRwXDhaoBclsV+DFN+kqbSxA/pS1PkI+JbSP+ g6rKFhuY/KWTRA7sbOHPr29TOTPzRZMgVYHoiTQeMUu09z+SgkfMexUPGiWYL9a9HWdomYkHY/0 1i3pHhCfAS8hdHKUcQRWIKjTQ+ufvSB5wNkE= X-Google-Smtp-Source: AGHT+IHyOo2SuZxIevYwuIjvF6W8iyzALg+rAxtRXfkz5XlSpHM9BQG5GV8srdF6hjf/UNy52LLw20w0hJXH8wROEhg= X-Received: by 2002:a05:6214:5d03:b0:6bb:a0f6:8b32 with SMTP id 6a1803df08f44-6bba0f68bcamr128392566d6.33.1722863757057; Mon, 05 Aug 2024 06:15:57 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 References: <73c0d611-16f6-ff3e-95a2-3c78c66d413d@php.net> In-Reply-To: <73c0d611-16f6-ff3e-95a2-3c78c66d413d@php.net> Date: Mon, 5 Aug 2024 15:15:46 +0200 Message-ID: Subject: Re: [PHP-DEV] [Concept] Flip relative function lookup order (global, then local) To: PHP internals Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable From: tovilo.ilija@gmail.com (Ilija Tovilo) On Mon, Aug 5, 2024 at 1:23=E2=80=AFPM Derick Rethans wrot= e: > > On Fri, 2 Aug 2024, Ilija Tovilo wrote: > > > As for providing a migration path: One approach might be to introduce > > an INI setting that performs the function lookup in both local and > > global scope at run-time, and informs the user about the behavioral > > change in the future. > > That INI setting would control the *warning*, and not the > *functionlity*, right? Yes, that was my suggestion. First, in a future minor version, an INI option could be added that would warn when finding both a local and global function when performing an unqualified function call. The only reason to hide this behind a setting is to avoid the cost of a double lookup in production code when one isn't necessary, i.e. when calling local functions in some namespace. > I am surprised that it is that much of a performance benefit as well, > but I am also concerned about the BC impact. But if that isn't too much, > then I guess we need to consider this, but only for a major version. Not > something I believe we can change in a 8.x version. Sure, waiting for 9.0 sounds reasonable if we were to choose this approach. Ilija