Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:126024 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 095101A00BD for ; Thu, 21 Nov 2024 12:46:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1732193333; bh=0eOwtLVM5EG1IGKXR0lYZGK2LACDe9prUwUyJBXgeds=; h=Date:From:To:Subject:In-Reply-To:References:From; b=NY9deuGj5N62WQi/i5kyr7Zi6ATPuMZDoTqf/jpXlSKLa86OW1gqvvD/LpPMCgTd/ awzjhWR+o4cW0PC2Cb0dbbGJRsEpnj/XzCjCEmPEoe7J8avupOxPPDasZbYMaoyk/a NY9Jbw6pT0K/+Z2x5iX+AD2vfgbk1/2a/7ZsIrKjhOytu8ygr/xFK5TX2qsO19OVZv VujhJPxlQYkpbQY73NIxJrVBb7TfjINxQcGQaD+EDjznGMV7A7NI5f61yrb14aVIaR GM55Avyf+UfwIn29VgzUW6WW2TTBsEKKvazbGjEXrlfchuKmpJQcjwXUv8XpJcyKkc SX9fQ/+BNlPKA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id E231118004D for ; Thu, 21 Nov 2024 12:48:51 +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.1 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from fout-b2-smtp.messagingengine.com (fout-b2-smtp.messagingengine.com [202.12.124.145]) (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 12:48:51 +0000 (UTC) Received: from phl-compute-05.internal (phl-compute-05.phl.internal [10.202.2.45]) by mailfout.stl.internal (Postfix) with ESMTP id AAE57114013C for ; Thu, 21 Nov 2024 07:46:10 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-05.internal (MEProxy); Thu, 21 Nov 2024 07:46:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rwec.co.uk; h=cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1732193170; x=1732279570; bh=0eOwtLVM5EG1IGKXR0lYZGK2LACDe9prUwUyJBXgeds=; b= gFTBWJIt1xe4JGZFd36mWZoA+brQm9+Cw/ywv6aClxZjEP7wLj0AkAi0Msil7cUD HdLIVbNDKD+xa4HFjkwlnVAuCW1NR8bFJ4LUUNfdx8lTyIELKKI1X+/l5bBm7LwL u7X5pNOr/TMvSCfbQDy73LTnMzue5OyioxKCQHuipUEx/J1QBJ2u7GcPuukmq/Cb 0H/0phgbh3nstQm5zAtHePLiL432/1uSOlsWCbE+SxrcfmAdMw/vmXJkQvvaUshk xdBVvvNK8AE/deBrLiTUzvs9xGJgbF9Pwu3qKCV9NZUhpCGoehCirXRrB1ecW2bR jeka+eGJ8fq55o2fy5ZJjA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1732193170; x=1732279570; bh=0 eOwtLVM5EG1IGKXR0lYZGK2LACDe9prUwUyJBXgeds=; b=skIpcZj3BOxc4T+p+ 6QKNroUyIASPajlObwpZaC77IvpHFbSG4fi+SFjGf/8Hk3TOrtOD5kiZrU4PlorX 5FdL0OCzPaDsi25oPyhVOwI5/OjHaYzI6U72HqUSDOm6qd3r/UtAY3Cxf6NlZq+W LWuQAApVv/hzWGDITFOhHLN2CqRYqVlbTvWZJz+k3dz4k3voDye3yD7s71a9gHRI nQN/gBpi3Q5BNsMPwsbBPLPh28Gksi8xaJtXSk/oYLsbeHuwDRjPXtqc0m9zT+Xu 3kyFpcbM8BHRvrLaqj/ooyP1LGKYs1SOFrwmdW2PvZYPIA4/eK8yldpFsLCLQMW+ kjkdA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrfeeigdegvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecunecujfgurhepfffhvffufg gjfhfkgggtgfesthhqmhdttderjeenucfhrhhomhepfdftohifrghnucfvohhmmhhinhhs ucglkffoufhorfgnfdcuoehimhhsohhprdhphhhpsehrfigvtgdrtghordhukheqnecugg ftrfgrthhtvghrnhepheelffetiefgveduteefudegtdduveeludegueegleehiefhhefg tdekveevgfelnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homhepihhmshhophdrphhhphesrhifvggtrdgtohdruhhkpdhnsggprhgtphhtthhopedu pdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehinhhtvghrnhgrlhhssehlihhsth hsrdhphhhprdhnvght X-ME-Proxy: Feedback-ID: id5114917:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Thu, 21 Nov 2024 07:46:09 -0500 (EST) Date: Thu, 21 Nov 2024 12:46:08 +0000 To: internals@lists.php.net Subject: Re: [PHP-DEV] opcache_compile_file() declares top-level functions User-Agent: K-9 Mail for Android In-Reply-To: References: <09E90996-133F-47FD-878F-5D1F7A99A3ED@rwec.co.uk> Message-ID: <71304D27-1884-4D7B-B3B5-5E5DB753F216@rwec.co.uk> Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: imsop.php@rwec.co.uk ("Rowan Tommins [IMSoP]") On 21 November 2024 10:48:46 GMT, Daniil Gentili wrote: >I speak for myself (and some others, as can be seen by pull requests on s= ome 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=2E This is still painfully vague=2E What projects? What "reason for it" did y= ou understand? When you say projects accounted for it, do you mean they got= some benefit from it, or that they worked around the problems it caused th= em? >There is indeed nothing wrong with the listed behaviours IMO, as they mak= e sense for how the current logic is working, and aren=E2=80=99t a deal bre= aker for preloading=2E This seems to be entirely circular - "the current behaviour makes sense fo= r the current behaviour"=2E >In fact preloading in a way behaves as if you included the preload file b= efore including the entry point Note that we are not talking about preloading, as a general concept; we ar= e talking about the specific function opcache_compile_file=2E That function= 's explicit purpose is to prime the opcache *without* behaving the same way= as including the file=2E=20 > functions cannot be declared twice, and already-declared classes are not= autoloaded again Finally, we seem to get to the use case you are actually advocating: preco= mpiling classes but using an autoloader to actually declare them; but fully= pre-declaring functions, because there's no autoloader for them=2E That certainly makes sense as a distinction, but I then wonder why you wou= ld use opcache_compile_file for declaring those functions, rather than a no= rmal include=2E Since you can't include the file a second time either way, = is there any way to make use of the difference? > it might be a nice idea to simply ignore the redeclaration of functions = (like for classes), instead of not preloading them at all=2E There is nothing that ignores the redeclaration of classes; they are not d= eclared when pre-compiling, and can be declared exactly once by passing inc= lude/require the pre-compiled file=2E Making functions match that behaviour= is what Ilija is proposing=2E Rowan Tommins [IMSoP]