Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:126021 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 70EC61A00FB for ; Thu, 21 Nov 2024 10:49:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1732186305; bh=b0Zm9ZiigSvf5JNDkvBAR4d4lP0WRixBFGzLDbD+oZU=; h=From:Subject:Date:References:To:In-Reply-To:From; b=TvUqe2EiCV8Er5hkdaFD9qxoj+9k5md9BbfVKToyOzvKNLs/V+ieR82LuOLbC8DE/ /ZvbKUhQTLVfCGrjdLUuM+2jEiLqnBxofA6SztrM/jVyF1oYO9xxaRpZlmwj7gHnV0 OLE5dRuNybiAuYH+0lkFuz5bGvS31Z1wpY/ohonkWpaGWIyrSc50drf81vi3SMMWNo A7+DwCNyp7eWExW1L19XNF3Hk20VYsWQfkryOC73WHaLkoJdEMGbPWqryEC6nV1DoA h3d1pBlHEe3WM/qDstvljMT1Rt7OUHgTMD/MsWmJufE7sq1YNV5eYfSWJfCMpKiicL IbIWNH+NMPv0w== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 3079B180510 for ; Thu, 21 Nov 2024 10:51:43 +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-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (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 ; Thu, 21 Nov 2024 10:51:40 +0000 (UTC) Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-431ac30d379so6473365e9.1 for ; Thu, 21 Nov 2024 02:49:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732186138; x=1732790938; darn=lists.php.net; h=message-id:in-reply-to:to:references:date:subject:mime-version :content-transfer-encoding:from:from:to:cc:subject:date:message-id :reply-to; bh=b0Zm9ZiigSvf5JNDkvBAR4d4lP0WRixBFGzLDbD+oZU=; b=FE5xfBJbRxn/JiIQqDupCYpS32OeOgz61eqPne3DR2RJdNvQ0MxWwlRUeJut7TFKUP kLG5Ij7sJIJOsp3GhtSXuMh08xVWU+8x7aC1w/gn4B0qWYF7tKbWlQaNIdwHyIEZtnMk 9fYL0XK0HkYy6+LnrD3R6sfykyCeUcIlXeTNaBlafaqhsBUAMKJ0k+vvyQkSDS3aGkn+ fGGqwyCyVgSeRMQvj757JFNdi3MozXDdDN5o7rGLY6RieMHF4DMabrh52D8glWrA0eQ1 dq0sGTY+pVRP3OqwcWa+qQhmONXAuEsvfeHiZDDxHRDaObeIjgmq+8fZubL6PU8T+JCj a5Pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732186138; x=1732790938; h=message-id:in-reply-to:to:references:date:subject:mime-version :content-transfer-encoding:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=b0Zm9ZiigSvf5JNDkvBAR4d4lP0WRixBFGzLDbD+oZU=; b=RAGVPsxR+Dz77yYbThAl+Xm2iuCBMapnXynIbq51p/xXvTYPrl3LGLiGKWqMsGmQhD F/EmC9FXelnKEYwdyXKTp9XeFVymDKJ5v9DQdgdZJff4At0XU54UiAmVJIUb1HCXTvN/ p7P0K4HJKWR374chq/uiXX1heIuFGWoDov4FT2IbekCKC/dHhg98jYIv9mq4u7GsMjhS iF2k7ciPpbXm6jqBMXbAoO1/Tx1q9tNclmcAdctRwj7McdAtS6y9bJoe8TUigMtCCNbJ gtoOSmdf2c7zKHzhveYkDiil/imsO/3JQWWObb6Y5ARmg1nVRN+kmMgVSNDgh4iANhw+ 8OAA== X-Gm-Message-State: AOJu0Yw0alRcMQ86XeUStLPHa67vvpmXvdchZ8i683EkwFWYugd0bl3y sreHKAq2uNbEJE123R8ZSqOyemXSNp7afjSjJMrD6y8L4TLa+Rm3Wk7WG3Gk6Ms= X-Gm-Gg: ASbGncu061Nuj7l5VMrOXqxx3L+Aahq/521JJ/+tJel6ALWDn6Oo8DfKvplZWo81tc9 Jg9cM6001aPaEcjs7eqxCjjhCA4koRQWqGkOmRI09eWCLnYQkEgQ3aCapHEkOAL4tgk8z/nV+Qj Dem9wCNyrAcpZixBCt9Mu8KkTOboEbtHnHvB7tMD+Wc1qMmtEzAffsDu/D9oqOkdgCcXFxRGlWS 2nYyYElzTqFNivX1j01QZWypztilZ1aEn01GRKqa24mwLMfi00WEdyuuBqF2kBX4CYk1LgEdfZS 1tJe8+eGO1aXxm/K9Q6md7hQH9kxt4GyYNOz0wrtsLuw X-Google-Smtp-Source: AGHT+IH+t2OYg/fv5cFqTEqHVmt3wkaztemgFMfqTmUY9p4d6RGgOQIyCaPfkQK10ggiMgqY0rNWnQ== X-Received: by 2002:a05:600c:3585:b0:432:d735:cc73 with SMTP id 5b1f17b1804b1-433489b2be0mr53804685e9.11.1732186138137; Thu, 21 Nov 2024 02:48:58 -0800 (PST) Received: from smtpclient.apple (host-95-229-168-3.business.telecomitalia.it. [95.229.168.3]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-432f64e7e12sm52181455e9.2.2024.11.21.02.48.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Nov 2024 02:48:57 -0800 (PST) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.200.121\)) Subject: Re: [PHP-DEV] opcache_compile_file() declares top-level functions Date: Thu, 21 Nov 2024 11:48:46 +0100 References: <09E90996-133F-47FD-878F-5D1F7A99A3ED@rwec.co.uk> To: internals@lists.php.net In-Reply-To: <09E90996-133F-47FD-878F-5D1F7A99A3ED@rwec.co.uk> Message-ID: X-Mailer: Apple Mail (2.3826.200.121) From: daniil.gentili@gmail.com (Daniil Gentili) > This reads rather awkwardly, because you're claiming to speak for some = unknown users ("those who used it") and even for the reader of the = message ("it does what you expect it to do"). >=20 I speak for myself (and some others, as can be seen by pull requests on = some FOSS projects, which made pull requests to account for this = behaviour), as a user of preloading who has encountered this behaviour, = understood the reason for it and made the required changes to keep using = it. > More helpful would be to say how *you* use it, or where you have seen = it used. Evidently it wasn't obvious to Ilija, and wasn't what they = expected. Since it's not mentioned in the manual, it's not what I would = have expected either. >=20 It was indeed not mentioned in the manual, and preloading is used so = rarely (as you can see, not even Ilija has been using it) that it seems = no one even thought of updating it :) > Ilija also went to some length to describe real practical problems, so = just saying there's "nothing wrong with this behaviour" also seems = unhelpful. Perhaps you could expand on why you think the problems = illustrated aren't significant in practice? > I would also be interested to know if you think the difference in = behaviour between classes and functions is explicitly useful, or just = neutral to your use case.=20 There is indeed nothing wrong with the listed behaviours IMO, as they = make sense for how the current logic is working, and aren=E2=80=99t a = deal breaker for preloading. In fact preloading in a way behaves as if you included the preload file = before including the entry point, and doing that even without preloading = would issue the same behaviour: functions cannot be declared twice, and = already-declared classes are not autoloaded again, so no error is = emitted (when preloading no error would be emitted anyway for = redeclaration of classes, but in the vast majority of cases when using = composer already declared classes are not re-included by the autoloader, = so the end result is the same). If functions could be autoloaded this edge case could be avoided without = having to add include guards, but alternatively, it might be a nice idea = to simply ignore the redeclaration of functions (like for classes), = instead of not preloading them at all. Regards, Daniil Gentili.=