Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127914 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 lists.php.net (Postfix) with ESMTPS id DD8521A00BC for ; Sun, 6 Jul 2025 11:12:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1751800259; bh=PJ/59MErWQFZcA5wLUHTH57mig/1uMcNOZjJtSlRb9M=; h=Date:From:To:Subject:In-Reply-To:References:From; b=gd+II4/6PWJgykFUXQaswjX/O3eh21xoacYCoJALJBu4FZivx4kyuQDCnkTNu1Fjt GllGdvCqm6wGJN+90tcsi8MPiALZuLQveOutC13e2+6ZPXxsfP+tD8TSS2gSBtY2nC de8qivpeE7NkATXVGnvzI9zyfUUb7/XIG5QkfQ1/KeK+LlIc5ji/t20PT4r1ReRut8 lXDJTz5qXKtvkdV9a1hlpdhqaJAzAvHoLZgs4P0gNL/BqqZG5OLCWnL0Ym7AMhGZ4K JAK98ZqQKkbBfFuJ3vlnO9hpJrqMDzUMKeJuM6rNNbuW+bUT6EEbAQrEh0j+XhARpS 7BkDp35kfJTgA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 87787180039 for ; Sun, 6 Jul 2025 11:10:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_20,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.1 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from fhigh-b4-smtp.messagingengine.com (fhigh-b4-smtp.messagingengine.com [202.12.124.155]) (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 ; Sun, 6 Jul 2025 11:10:58 +0000 (UTC) Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfhigh.stl.internal (Postfix) with ESMTP id 19ADB7A00CC for ; Sun, 6 Jul 2025 07:12:42 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-01.internal (MEProxy); Sun, 06 Jul 2025 07:12:42 -0400 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=fm2; t=1751800361; x=1751886761; bh=PJ/59MErWQFZcA5wLUHTH57mig/1uMcNOZjJtSlRb9M=; b= SoS6DHnWa2v+MXd2mgKloqxIX7qHvH3Mnwhe/BCCrE5cva/NGUXqBQWuwRotoA1m IPnCG9mcGstkFF9RlqM5EQ4GaHt5UTVdyECeDj1o/W0KdB9RinZ9B6arGDz6QFLi u0O+//rZMmPqeE0NE72yvKcAYRjlxRbAR1o4asl1arp907N7eF6tr9a9ICJHFhO4 1LGS3ZapkxBMTsqqftSCZrZ1Vy86WUzHMovJ8p0F7sFBqRhQw5taLSoUbq2PTk7Y rkcEvSOei2qjEYbPx2+3X8dT+rlJiB5clbli+R4CGcR8Dco3Ps8AyEOuRyJ0ShTV 5eaZZ1QUmzIvirBDsBzxMw== 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=fm2; t=1751800361; x=1751886761; bh=P J/59MErWQFZcA5wLUHTH57mig/1uMcNOZjJtSlRb9M=; b=dcZTwCbfSTHfZOzRv qxtWR+GNBroCjk8wbv3mzm8WKenZbbG2OYUyY74n96ckueNBOlNp6s0+L0d9d9Sr h7632oBuc9RZ/mBbEK7ILpPK21EoyUi/o4NEagMOVJ86l6Zyieceo19ZNpvtG5Fk QZaBZZ1Eg2Sp0Yyvr15p7T5Jqm/EpM33lcaygwokRHcwF1JUMuWJPX4Ew7xz48Tv M0GBzpJODtnWfylkIBiPLqv840tjNuZpqLHOUGySzkUnTSkkd1IXwrGaE9Lfx8Kd Q19P5D/vXGOzpKT7fQVE4WGxnr/c2bVYcF6mwX39IwX37EqqqogfoyENEwfcFPpj ff/Rg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdefgddvkeejjecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecunecujfgurhepfffhvffufggjfhfkgggtgfesthhqmhdttd erjeenucfhrhhomhepfdftohifrghnucfvohhmmhhinhhsucglkffoufhorfgnfdcuoehi mhhsohhprdhphhhpsehrfigvtgdrtghordhukheqnecuggftrfgrthhtvghrnhepheelff etiefgveduteefudegtdduveeludegueegleehiefhhefgtdekveevgfelnecuvehluhhs thgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepihhmshhophdrphhhph esrhifvggtrdgtohdruhhkpdhnsggprhgtphhtthhopedupdhmohguvgepshhmthhpohhu thdprhgtphhtthhopehinhhtvghrnhgrlhhssehlihhsthhsrdhphhhprdhnvght X-ME-Proxy: Feedback-ID: id5114917:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Sun, 6 Jul 2025 07:12:41 -0400 (EDT) Date: Sun, 06 Jul 2025 12:12:40 +0100 To: internals@lists.php.net Subject: Re: [PHP-DEV] [RFC Idea] main() entry point for PHP User-Agent: K-9 Mail for Android In-Reply-To: References: Message-ID: <363EED9F-7F0A-425C-805C-372A35E2865E@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 4 July 2025 15:49:59 BST, fennic log wrote: >This is basically an idea I have for PHP to support a main entry point=2E >Where regardless of execution, if you run a PHP file, in CLI or Web >request=2E >If the file that is executed contains a main function, that is >automatically executed by the engine after any procedural code=2E Can you explain what problem or use case this is trying to solve?=20 As others have pointed out, if you're running procedural code and then cal= ling "main" with no arguments, it's equivalent to adding one line of code i= n the file, even including the return code: exit( main() ); Is there a specific scenario where you see an automatic call being a signi= ficant improvement over that line? Rowan Tommins [IMSoP]