Newsgroups: php.internals
Path: news.php.net
Xref: news.php.net php.internals:125072
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 BB7DF1A00BD
	for <internals@lists.php.net>; Tue, 20 Aug 2024 15:14:22 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail;
	t=1724166971; bh=dm333DoEtbYxfmpOq2AL9TkdAVYei/rI1Wq6pZklrj8=;
	h=References:In-Reply-To:From:Date:Subject:To:Cc:From;
	b=ZWkEBgJQ19SEILrsVYRUNxaQiHaek3wHv6ud83pLHSHFbMlIiuflGKTISJlMEaFDK
	 OwnBxRTIUidkS2iJs7+X87Ix4Qy422IwhHaGu9dTUBO6JE47TgsAtjrmK+Kx1vMxN8
	 bT3ls6DEx/nTCqM6nhKq8/SIsS4y+Y4ZBHt2L+kHXkPYhof+bS2/EzIQNUGcvRyYAF
	 ioWdcd6OtQpY06C5qYuJXjXbA3Fk2MUtjz4yVyMl1ySEvWNsHJ0ucgUlcxEWg22hQi
	 OmQUDj84k+tPncDkl4B9NtekeQ+s9SYt0oyVHubpHNDCGjldaBebAbuwGvrGnzSf+N
	 /QeF8a/AWxgbA==
Received: from php-smtp4.php.net (localhost [127.0.0.1])
	by php-smtp4.php.net (Postfix) with ESMTP id 25782180077
	for <internals@lists.php.net>; Tue, 20 Aug 2024 15:16:08 +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,RCVD_IN_DNSWL_NONE,
	RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,T_SPF_TEMPERROR autolearn=no
	autolearn_force=no version=4.0.0
X-Spam-Virus: No
X-Envelope-From: <levi.morrison@datadoghq.com>
Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.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 <internals@lists.php.net>; Tue, 20 Aug 2024 15:16:07 +0000 (UTC)
Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-3717de33d58so3631093f8f.1
        for <internals@lists.php.net>; Tue, 20 Aug 2024 08:14:18 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=datadoghq.com; s=google; t=1724166857; x=1724771657; darn=lists.php.net;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:from:to:cc:subject:date:message-id:reply-to;
        bh=dm333DoEtbYxfmpOq2AL9TkdAVYei/rI1Wq6pZklrj8=;
        b=VrkMms/h/DjMJvUKhLwu8Jt7kZifLpgDyci14IOCrgQpjvXed9jwKCsJQI/+U0L7Zi
         L2RDCzc4BwdZWayKvReaIshmrYEPMBN+oQn6aYET4Zj+XH7QaD6J5Tn4wRmLXmvUhsJR
         OUUxWWgCC3zgaK/D2Jia9wnfGWys0NXIfea+I=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724166857; x=1724771657;
        h=cc: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=dm333DoEtbYxfmpOq2AL9TkdAVYei/rI1Wq6pZklrj8=;
        b=UmQ4gB6d7Cloky+vEqBdbnGSTJ2C6t7H4OlP1zFqDV4YD6USiR2Ru3GGSEcg9k3Z5E
         e+yUtRHgvH50tpqx6IYfQatHWmzdCOrobYk/yrbjPUO3tsDHe0/aRjvWz3hYUDtH7JXT
         0oLGR5PHO1tUqds4CMVJvNoSErUTFmx0hWOUm84atL5gvgV2wWe31jf1YW+vzrkj7PJs
         WU8ZTRpNjrMCrL/GXO90XG2qhvfNPDQAeoAk7AYe8HOGOPPwD7okRb8UosEQMiXGsy5J
         LC7QXzYVgYIkwxfXKtM1R3cao6GBpTBx6zaxzFnDr32bUU+PVz3y3zZpBkULkV6KLYk2
         Bf/Q==
X-Forwarded-Encrypted: i=1; AJvYcCVoJ5+LX94muj0jKK5fa7KEImntVOGbt+8rrP9ZqNNPP5NcS/sHiOe9cvMBodYw7wUs1a3WmLFABZQ=@lists.php.net
X-Gm-Message-State: AOJu0Yy0DVvLzCdLorlppo3RBuUfgeCctu+5v27YDdaQnFQ/XqpDfqoQ
	eJZnRXPa/tOWUEM5e+ocMQoc/U70C8Rkipr8P2xyInZvi6Gob1PWm6f1IY0cKdzllktIDPkVmIK
	A+UlFZ3olSHZIu+AZ+mwOoL6bs2m/U0mupj7g7h3sRpIFWaBoBEc=
X-Google-Smtp-Source: AGHT+IHSn08jmfe4c2YN2l66nm9TlwV/ihPJafmgqT6ygMgoDb0rb61Zs6iqySG/V5fT5+BttVrIog95EcbBt1qILEc=
X-Received: by 2002:adf:a39a:0:b0:367:bb20:b3e1 with SMTP id
 ffacd0b85a97d-3719469fcb0mr10313832f8f.51.1724166856574; Tue, 20 Aug 2024
 08:14:16 -0700 (PDT)
Precedence: bulk
list-help: <mailto:internals+help@lists.php.net
list-unsubscribe: <mailto:internals+unsubscribe@lists.php.net>
list-post: <mailto:internals@lists.php.net>
List-Id: internals.lists.php.net
x-ms-reactions: disallow
MIME-Version: 1.0
References: <CAPyj-LCoBY2bPHLmsyONYDbY9aRSraLz5QNskeTiWfpMD0pTSg@mail.gmail.com>
 <c385b525-37f7-446b-aa96-72272ef9e407@app.fastmail.com> <CAPyj-LA4kTJTrQZUkn9kNMvWdH6SsFGU5mBO6EcpuUcRpXesgw@mail.gmail.com>
 <CAAwdEzDqcCa-rQMFmD+6mQ4wWHJW+8Bi4_5LQ3GbfcK4PCYp3Q@mail.gmail.com>
In-Reply-To: <CAAwdEzDqcCa-rQMFmD+6mQ4wWHJW+8Bi4_5LQ3GbfcK4PCYp3Q@mail.gmail.com>
Date: Tue, 20 Aug 2024 09:14:05 -0600
Message-ID: <CAAKU0umwCHfJicXzwbahQeYF1f4DhWkpAtURxOiZjiq4bQ+qUw@mail.gmail.com>
Subject: Re: [PHP-DEV] [Concept] Flip relative function lookup order (global,
 then local)
To: =?UTF-8?Q?Alexandru_P=C4=83tr=C4=83nescu?= <drealecs@gmail.com>
Cc: Ilija Tovilo <tovilo.ilija@gmail.com>, PHP internals <internals@lists.php.net>
Content-Type: text/plain; charset="UTF-8"
From: levi.morrison@datadoghq.com (Levi Morrison)

> To sum up, I think we need to remove the fallback behavior, so we can have better things in the future.
> Either keep only local with a bigger BC break but a better language consistency.
> Or keep only global with a smaller BC break.

I have long been in favor of a larger BC break with better language
consistency. Class lookup and function lookup with respect to
namespaces should be treated the same. The difficulty is getting a
majority of people to vote yes for this. Keep in mind that qualifying
every global function is annoying but probably can be somewhat
automated, and will bring better performance. So again, this improves
the existing code even without upgrading.

Yes, there would be complaints about it. Yes, there are probably some
people or projects who wouldn't upgrade. I don't particularly care, as
there are increasingly more operating systems and companies providing
LTS support for long periods of time. Probably Zend.com will offer LTS
support for the last PHP 8.X release, and possibly there will be some
distro which also has it. I believe it's the right thing to do
because:

 1. It's faster.
 2. It enables function autoloading in a similar manner to class autoloading.
 3. It's more consistent, and simpler to teach and maintain.

It's rare that you get all of these together, often you have to make
tradeoffs within them.