Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:131063 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 3955F1A00BD for ; Fri, 29 May 2026 16:26:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1780072010; bh=bqcUBG/BHTwBLRE1r2svF4cKVD5UvJ1iTxTolXrWD7Q=; h=References:In-Reply-To:From:Date:Subject:To:From; b=oMOYNV0SzpR7Rh9/b5qhDS7pO5dynQP6Vpv+I4K4VXUujfEBR5zEUs62WLCmlgZ/D bkoXeJwKQ/YBj97lGZA2uPzrZxzTY65g4ZPLfbBWYFIShubtPPYdB5ypUjbszSAAOF Hl9zM4CH56uekocmeDRpobhM+EAyaiZVqgW/mgHs5ThV3l4szfbqvOOyGyB0OwyoN9 j6gGbmTqzJIAO9qePp6F7HltEawyhlRG3XlBkt+xph2IK5IGQq5JkrA++FLnPgiqOW Ve3QPG5flbaBqi/wcBRDLmewmH4lFABOEtJ12c+pKu6d//L6uN7IW4K6gL1KBmeVdI ftpTes0ecN/7A== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 9865B180820 for ; Fri, 29 May 2026 16:26:47 +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.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from mail-lf1-f53.google.com (mail-lf1-f53.google.com [209.85.167.53]) (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 ; Fri, 29 May 2026 16:26:45 +0000 (UTC) Received: by mail-lf1-f53.google.com with SMTP id 2adb3069b0e04-5aa619653e4so2871e87.1 for ; Fri, 29 May 2026 09:26:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1780071998; cv=none; d=google.com; s=arc-20240605; b=JnMzRu6X9S0/qTVhQGyxxy+OTOHizYfNv5KxlQnu5Swf1hIc6Mo5lc4WKgSMKiJzPB i/Y0ECfzz+EytCl4yaRmMc3uw6sZq8i0ekuQAmgUVmyf8tS7v94KbMjyJ3XBtvx3VXn/ nQYL1yBtTdjY10+cOsIj9hhq60pOyme0TVCGAkH9VaNm23wpusJPuQid4SME7v1bJzWg i/p+rBgI0J45x2ZmE38ENlEmQorlaZmwEVrJLtlXKEi87rsMQ3BXSj/M8Ti5RL2SNuJK zbctoDGHZkGNgqepESpEsGFXbRZtA1N16thz9HMHeIIA24dswKzQCE3mh4VKvPgM2fkU Op7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=DUqNBF7unJGSFYzcqiFdiMcfrE//lnq7euLjZqqeA9E=; fh=PwvV1jWZOR90rDIG/6XexqaHJyAFBTdnFVhsS64qdEQ=; b=U5WgXg+5ocjiQNi6JRs26Z9JxDAlydJn3SoPtyeARD/Qnpcaqdku4Odp39ARKvoH2E A6MhvoneMXPjO9M/aKwFuKib1SmP39mrQKhyhRHGaNdBN3tUz1HSST4ZYgh857HBwhr+ ZIfMQM1lz4YlDdM3J7kB3B5c98QpYkLdCDGSG1tU6oAJvJsrThjcFJ/z3V9LOYOMtcVX Hp6yD5psqLvRRahTp2c4zWazpM7pyaXdg4QCoF84rdZdXZLYQfAnI6MftPUXlj/5aPaw BhG1TAutBvdKX4kGj4JM2gNi7sYncpqoC8uLB6SlCVq8z9R0rvlbgSjUwK9iFePO7K+h LtUQ==; darn=lists.php.net ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1780071998; x=1780676798; darn=lists.php.net; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=DUqNBF7unJGSFYzcqiFdiMcfrE//lnq7euLjZqqeA9E=; b=Z8Du5jF+qAqyF1YATaMvjyvMhl+uzgAhJjEuzHFi8XjtETmSLk3GPZs8EW/KbyXSjp q2h6JZkYYbYdplWi77z+cNtX5o54HhcUYhwusLGXpq61W+AAi8Y8QTUVoXeVYLeCccpO LMhfO9d5XpYe/nUyUETokUUjR0/AAIjERIWcS9N/kV1H7c51I4NIEbFKl/A764HS0Bme RO1Be42gJVaJYtUW8MFAvKUgGXvZ2Mc8Kn3X7HfQRMs6mkaAo3Tlc7WXZJQvLroaCScl 4ur5Wrm50hkCeSj7UU9MixRFXB8mq0lXIh6gIAjsinHCynz8Dvg8AbtN/+UJ0aP1VHBs Yomw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780071998; x=1780676798; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=DUqNBF7unJGSFYzcqiFdiMcfrE//lnq7euLjZqqeA9E=; b=MCRKLpYkanuccgWighQAkxjoSGuCd5SBHmOOqf+me5pK665m+DIfb3skb1xW4uYZ9A 3L3UTlz2/XT4A1szQmo1pStypaaElgGzFmKnRCOc7iL2kmPrqLRr97LwH+NI3x4XM9/n SA2OOxhJySiFSCmZDVzmVDQJlQaZ1qXqENWS+ZyiR4JXyee1P7VZURnYy+VzjPQdkPyH c/pBB+gPBFMR2iXJ9d8UC9IEzw5dJWFGdQwLyjQm1GQltnBn0Bc4nNcjqtyiykmOPT/s qMPRmKZXtlZN+Y2MbKNALrjvANNOun/WcaMNjWBWCFbHfalaSMIqhFXOp6A+h48v6n+T 80yg== X-Gm-Message-State: AOJu0YxYaNdcsvno6z9aVsRrg90nrRTWrVfWe+VlSOD8rhq2eV4A+phy ZrzOC891VaVrj+3MZEeWVx4Xb1Lk4i5TL90xbCE9b0A3MP7PGo1LvlG2pwIaTUpQcZaZDEA+hrN mNQdzkfl+ai4ktzZSet4+sSxYE3INkBuWbj86 X-Gm-Gg: Acq92OG/UmJNaYEltA3ejvX+TJpgw+7NyWZolN5lYjVdzKUAqUYaOe05o3ejmRU7Cw5 t0jqXHRfyNAkRx3OmyFm7+91gQWtRwsf4CQyioLsgu4w7WMiPm/u+HFG8BRSBQgsz6YKv8/fA2h wFtjG4lrwR3yK/Re6AMg1VEs2KjF/vzFAgUXXgSqdtr5tCfTq3+MSCi3VShlnWRAem2XzcBRpDL ZBHWS1gQVsBwavTBsGFfuJI5CBkOY+KJaHTdCjmQCsnuCenxheNmajU9x6+cKhRhs/qxWx0d41m Zgl3npuJsu6u6kJ5m2QuxNt857TKXROwNqQ8zBPnOeiN9jGH X-Received: by 2002:a05:6512:234a:b0:5a4:1ab7:77ba with SMTP id 2adb3069b0e04-5aa58fc7d09mr1144099e87.8.1780071998372; Fri, 29 May 2026 09:26:38 -0700 (PDT) Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 References: <9E95EA03-B86A-D248-A980-B1E838F94C13@hxcore.ol> <11B6D9B0-2555-4FC4-B540-71680315589F@gmail.com> In-Reply-To: <11B6D9B0-2555-4FC4-B540-71680315589F@gmail.com> Date: Fri, 29 May 2026 12:26:26 -0400 X-Gm-Features: AVHnY4KneG_K9TdIUxcLRrrjB7ARVBpOYQftmsA2K5dRQ330Cmcq0aMM-fmRXW4 Message-ID: Subject: Re: [PHP-DEV] [Pre-RFC] Pure-code source files via .phpc extension To: PHP internals Content-Type: multipart/alternative; boundary="000000000000233f380652f74fe8" From: tendoaki@gmail.com (Michael Morris) --000000000000233f380652f74fe8 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, May 28, 2026 at 11:35=E2=80=AFAM Hendrik Mennen wrote: > > > Fair, and I have heard this from both Ben and Alex earlier in the thread. > My pushback there has been that the engine already has the filename > available at zend_compile_file and at include/require resolution, so > teaching it to check the extension is additive rather than architecturall= y > violating. But I take the point that this is a cultural preference on the > list, not just a technical one. If there is a workable alternative that > does not have the caller-vs-author inversion problem I raised in my reply > to Alex, I am open to it. > I can't think of one to be honest. The parser needs to know how to handle the file. That's going to come in the form of the extension or in the calling statement from within PHP. Any extension choice comes with the potential BC break that someone, somewhere out there has used that extension before. > > > 6. I would caution against any code only include being implemented > > without taking the opportunity to fix certain bugs that have gotten > > to stick around because of the enormous BC breaks such fixes > > introduce. There are no existing files in this format, therefore no > > existing code to have a BC break. This is a rare opportunity to > > clean some things that should not be passed on. Please, Please look > > into this as part of this. > > This is the most important point you raised and I want to be careful with > it. You are right that introducing a new file format is a once-in-a-decad= e > opportunity to ship semantics that would otherwise be blocked by BC. Your > Modules proposals have been built around exactly this argument, Hack took > the same route, and the temptation to bundle improvements is real and > well-founded. > > My reservation is purely tactical: every additional semantic change is an > additional reason a voter might decline. An RFC scoped to "new file forma= t > that starts in scripting state" is already non-trivial to defend. An RFC > scoped to "new file format with stricter type juggling, no eval, no > variable variables, automatic strict_types, no @ suppression" is a > substantially harder sell, and the list has a history of preferring focus= ed > RFCs over Christmas trees. I want to avoid the derailment pattern. > > I think the right approach is to surface this in the RFC text as an > explicit Open Question: "Should pure-code files differ from .php files in > semantics beyond the entry parsing state, and if so, in which specific > ways?" Rather than committing to a list now, I would let the list propose > specific cleanups and only include those that have clear consensus. > > Given your years of iteration on this concept, you almost certainly have = a > more grounded list of candidate cleanups than I do. Would you be willing = to > share which specific bugs or semantic issues you had in mind? Some that > come to my own mind: automatic declare(strict_types=3D1), banning variabl= e > variables, banning @ error suppression, banning the global keyword. But I > would value your concrete examples more than my abstract candidates. > Those would be a good start. I don't know of any others offhand because I don't know the engine. I'd have to dig around in the rfc archives to find other examples. There's a bit of a quandary here - just removing the need for the markup doesn't come with enough upside to be justified on its own in my opinion. It might be doable with the requirement that if a php file doesn't start with , :: ) where its sister languages get by with only one ( . ) which PHP uses for a different operation. But I believe that runs into similar problems as the reason why PHP requires $ to lead all variables, it has to do with how the engine handles these symbols. I suspect that some of these problems are intractable and even if they can be solved the performance hit in solving them might be severe. If that isn't the case (or isn't the case anymore) then those structures too would be worth review. This rounds back to a weakness of the RFC process - it works best for small to medium scope changes. Decisions on large architectural paths are more difficult (but not impossible). I got quiet on modules because I don't have the skill to follow it through, or the time to develop those skills. I was working with Rowain on a possible path last year, but got distracted by work and dropped the ball. The problem scope for that, though closely tied to this, is uncomfortably large. --000000000000233f380652f74fe8 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Thu, May 28,= 2026 at 11:35=E2=80=AFAM Hendrik Mennen <hmennen90@gmail.com> wrote:


Fair, and I have heard = this from both Ben and Alex earlier in the thread. My pushback there has be= en that the engine already has the filename available at zend_compile_file = and at include/require resolution, so teaching it to check the extension is= additive rather than architecturally violating. But I take the point that = this is a cultural preference on the list, not just a technical one. If the= re is a workable alternative that does not have the caller-vs-author invers= ion problem I raised in my reply to Alex, I am open to it.

I can't think of one to be honest. The parser nee= ds to know how to handle the file. That's going to come in the form of = the extension or in the calling statement from within PHP. Any extension ch= oice comes with the potential=C2=A0BC break that someone, somewhere out the= re has used that extension before.
=C2=A0

> 6. I would cautio= n against any code only include being implemented
> =C2=A0 =C2= =A0without taking the opportunity to fix certain bugs that have gotten
> =C2=A0 =C2=A0to stick around because of the enormous BC breaks s= uch fixes
> =C2=A0 =C2=A0introduce. There are no existing file= s in this format, therefore no
> =C2=A0 =C2=A0existing code to= have a BC break. This is a rare opportunity to
> =C2=A0 =C2= =A0clean some things that should not be passed on. Please, Please look
> =C2=A0 =C2=A0into this as part of this.

This is the most important point you raised and I want to be careful with = it. You are right that introducing a new file format is a once-in-a-decade = opportunity to ship semantics that would otherwise be blocked by BC. Your M= odules proposals have been built around exactly this argument, Hack took th= e same route, and the temptation to bundle improvements is real and well-fo= unded.

My reservation is purely tactical: every ad= ditional semantic change is an additional reason a voter might decline. An = RFC scoped to "new file format that starts in scripting state" is= already non-trivial to defend. An RFC scoped to "new file format with= stricter type juggling, no eval, no variable variables, automatic strict_t= ypes, no @ suppression" is a substantially harder sell, and the list h= as a history of preferring focused RFCs over Christmas trees. I want to avo= id the derailment pattern.

I think the right appro= ach is to surface this in the RFC text as an explicit Open Question: "= Should pure-code files differ from .php files in semantics beyond the entry= parsing state, and if so, in which specific ways?" Rather than commit= ting to a list now, I would let the list propose specific cleanups and only= include those that have clear consensus.

Given yo= ur years of iteration on this concept, you almost certainly have a more gro= unded list of candidate cleanups than I do. Would you be willing to share w= hich specific bugs or semantic issues you had in mind? Some that come to my= own mind: automatic declare(strict_types=3D1), banning variable variables,= banning @ error suppression, banning the global keyword. But I would value= your concrete examples more than my abstract candidates.

Those would be a good start. I don't know of any o= thers offhand because I don't know the engine. I'd have to dig arou= nd in the rfc archives to find other examples.

The= re's a bit of a quandary here - just removing the need for the <?php= ?> markup doesn't come with enough upside to be justified on its ow= n in my opinion. It might be doable with the requirement that if a php file= doesn't start with <?php it must instead start with the namespace d= eclaration, but is this worth the potential confusion.

=
This honestly would need to be part of a larger syntax cleanup effort = for the benefit of both the engine and the users. The largest single wart i= n PHP syntax is the having three scope operators ( \, ->, :: ) where its= sister languages get by with only one ( . ) which PHP uses for a different= operation.=C2=A0 But I believe that runs into similar problems as the reas= on why PHP requires $ to lead all variables, it has to do with how the engi= ne handles these symbols.=C2=A0 I suspect that some of these problems are i= ntractable and even if they can be solved the performance hit in solving th= em might be severe. If that isn't the case (or isn't the case anymo= re) then those structures too would be worth review.

This rounds back to a weakness of the RFC process - it works best for sm= all to medium scope changes. Decisions on large architectural=C2=A0paths ar= e more difficult (but not impossible).

I got quiet= on modules because I don't have the skill to follow it through, or the= time to develop those skills. I was working with Rowain on a possible path= last year, but got distracted by work and dropped the ball. The problem sc= ope for that, though closely tied to this, is uncomfortably large.
--000000000000233f380652f74fe8--