Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:122486 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 4B38A1ACEBF for ; Sat, 24 Feb 2024 05:34:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1708752873; bh=GJcnQVuT39nyBZ2B0w46wDr5EVLq4ujpVCVwAfGbUQI=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From; b=VQcD1O7zv0fMv7c9Ol0JoziHOSSCShKsJWrClVPobGcsrRqcf/EqZyYAYkUZlvSAZ URdk638v7i8qZZrP2bb4ut/lww3b6bZtODnEp1MFmSFlVJ4cUEprSjy2LDVmQhUIhC jv19Us13Cob/+8Q3BBylTOwKooaeK6SnsRIROL/DIY+If0oWQ6X/3T5LGTTRjZd2ZH yBb0wHCSg5CbvbDYCROjzaoeWByZgzWu3gC00lIIxoWJC7J1bynRAvrgomxhVnPEJE vbUFJZYBt0BM7ktm3UQ5G9xDoU0/gR3LQJpXyV62kqB9tZ5frh5dH7S1MxS/Pe7AE0 /nwezTv5/BqkA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 0D60F180042 for ; Sat, 24 Feb 2024 05:34:32 +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=1.3 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_40, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING, HTML_MESSAGE,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, SPF_SOFTFAIL,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from hamster.birch.relay.mailchannels.net (hamster.birch.relay.mailchannels.net [23.83.209.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 23 Feb 2024 21:34:31 -0800 (PST) X-Sender-Id: a2hosting|x-authuser|juliette@adviesenzo.nl Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 0E7941022C2 for ; Sat, 24 Feb 2024 05:34:24 +0000 (UTC) Received: from nl1-ss105.a2hosting.com (unknown [127.0.0.6]) (Authenticated sender: a2hosting) by relay.mailchannels.net (Postfix) with ESMTPA id 0624E102160 for ; Sat, 24 Feb 2024 05:34:22 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1708752863; a=rsa-sha256; cv=none; b=fHRn0rWd5bxTvVoLjAAnK8Cvbs/QmZ73q4XSR9mopGqqaSx3xxmR4xJ4gPDdky0v/8NXnO oIrVMfkZzfi/qloj+vvqtiaRAPx4kT37IikVcu2UcpZT6xeFSqvCjzevug0FbOOcijPWmd qOJt7Rbr1c9jU3NChZP2u4mg3fRy5nmOywqXgeuU36lC0Oaj850y/Y8vp+jLmFYR307k6L VYdAd9fSLb1rbBMzteVhRfV/ViluQXrzRiusmZMFhdgDvLAjskQGml/kWEpz+KZHERqOtj 6/MUqlRecpjn81+k4T0vF5pJaYrcCQnHcbusQCWwoJo+zDDxUZBETu21EJtOVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1708752863; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:dkim-signature; bh=HDiLnbxS78v4OBvfxxxWrGSAZU0jw6VDHGcMhR6Jqc4=; b=blO0qCWcmA5D+geJ1fhIK4aBPkciHQm6hV2cHqWVnaRyI72pCkleMMI3Q3TKVX8yGknZ+d /sbtJe7EfJsZAqRfnXYnMuAqSmWBq0tNYGlAG2eL61D8zkIcREXgmbGr03drQFWWcc0oN8 NFEyva2S9vLVRcdIQud87T0NuL7O5TBQxAQCoFLt+p3b8w1iuA59rV1kbwxWecmz4C+U59 M6YnNYhjSIx6eXTM5eCM5xhTOxNBlXMVWVZpYUVyujjVJqAOpdMg4DRl4eqLzLe+IdZMTg yUMRFWoa4C0GBc103F4u2NVZjv0KLeFTuqt+RC+LQE3jCmU5KD+Ei1N7DgVJAg== ARC-Authentication-Results: i=1; rspamd-55b4bfd7cb-jlpd4; auth=pass smtp.auth=a2hosting smtp.mailfrom=php-internals_nospam@adviesenzo.nl X-Sender-Id: a2hosting|x-authuser|juliette@adviesenzo.nl X-MC-Relay: Neutral X-MailChannels-SenderId: a2hosting|x-authuser|juliette@adviesenzo.nl X-MailChannels-Auth-Id: a2hosting X-Unite-Hook: 7bba83f04b2c43f8_1708752863714_1025695181 X-MC-Loop-Signature: 1708752863714:671733194 X-MC-Ingress-Time: 1708752863714 Received: from nl1-ss105.a2hosting.com (nl1-ss105.a2hosting.com [85.187.142.69]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.116.14.46 (trex/6.9.2); Sat, 24 Feb 2024 05:34:23 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=adviesenzo.nl; s=default; h=Content-Type:In-Reply-To:MIME-Version:Date: Message-ID:From:Cc:References:To:Subject:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=HDiLnbxS78v4OBvfxxxWrGSAZU0jw6VDHGcMhR6Jqc4=; b=J69oc8PWcKJylUbHuyBYjJgRxx +nzooQa8urha8Fwg2KPp1ItQwLtJJMlGBSS4ywJI0BcK+PVhgxDxebgs7Y0qRa5qVe63bMrUTg1Q2 +Iab5QndDkmuVwLkqYLcEZB/lzrCNKSDX+4v219jJ44+TkSPX9T7YZm7/6732VpSKgHs=; Received: from mailnull by nl1-ss105.a2hosting.com with spam-scanner (Exim 4.96.2) (envelope-from ) id 1rdkg1-005AhC-0l for internals@lists.php.net; Sat, 24 Feb 2024 06:34:21 +0100 X-ImunifyEmail-Filter-Info: UkNQVF9DT1VOVF9UV08gUkNWRF9WSUFfU01UUF9BVVRIIFJD VkRfVEx TX0FMTCBUT19ETl9TT01FIFZFUklMT0NLX0NCIFJDVkRfQ09VTlRfT0 5FIEJBWUVTX0hBTSBBUkNfTkEgVE9fTUFUQ0hfRU5WUkNQVF9TT01FI E1JTUVfVU5LTk9XTiBJRV9WTF9QQkxfQUNDT1VOVF8yMCBGUk9NX0hB U19ETiBNSURfUkhTX01BVENIX0ZST00gSUVfVkxfUEJMX0FDQ09VTlR fMDUgSUVfVkxfUEJMX0FDQ09VTlRfMDEgTUlNRV9UUkFDRSBGUk9NX0 VRX0VOVkZST00gQVNO X-ImunifyEmail-Filter-Action: no action X-ImunifyEmail-Filter-Score: -3.22 X-ImunifyEmail-Filter-Version: 3.5.6/202401180837 Received: from [143.178.154.86] (port=52324 helo=[192.168.1.16]) by nl1-ss105.a2hosting.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96.2) (envelope-from ) id 1rdkg1-005Agz-0P; Sat, 24 Feb 2024 06:34:21 +0100 Subject: Re: [PHP-DEV] [Pre-RFC] Convert exit (and die) from language constructs to functions To: "Gina P. Banyard" References: <65D94D20.6020702@adviesenzo.nl> Cc: internals@lists.php.net Message-ID: <65D97FC1.2060203@adviesenzo.nl> Date: Sat, 24 Feb 2024 06:33:53 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------080202020006060304010802" X-AuthUser: juliette@adviesenzo.nl From: php-internals_nospam@adviesenzo.nl (Juliette Reinders Folmer) This is a multi-part message in MIME format. --------------080202020006060304010802 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 24-2-2024 3:47, Gina P. Banyard wrote: > > > On Saturday, 24 February 2024 at 01:57, Juliette Reinders Folmer > wrote: > >> Hi Gina, >> >> I'm not sure a pet-peeve is a good motivation for creating an (I >> expect large) breaking change. >> >> The upgrade path, I suppose, would be updating calls to `die`/`exit` >> to always have parentheses ? Or alternatively changing those calls to >> new throw expressions ? >> >> While that shouldn't be that huge a problem for real codebases (and >> would be auto-fixable for adding the parentheses), the bigger problem >> I see is the huge amount of teaching materials, tutorials and blog >> posts using the versions without parentheses which will now all be >> invalidated. I think the pain and confusion that will cause for a >> change like this, will linger for years and years. >> >> Smile, >> Juliette >> > > I didn't actually know one could do exit; > But like I said, it is extremely easy to support, and the current PR > does support it by hooking into the undefined constant code in the engine. > I don't have strong opinions about removing support for this. > However, I do have strong opinions about changing the type juggling > semantics of exit() to be the usual ones, because the current one is > just confusing. > I am also not sure what would make this a large breaking change, as > changing this from a language construct to a function provides us with > more capabilities. > Ah, I think I missed the part about the syntax both with and without parentheses still being supported, with the "with parentheses" mapping to a function call and the "without parentheses" mapping to a case-insensitive constant. In that case, I don't see a BC-break and I would regard this as an "under the hood" change with only a very subtle, minimal impact (the type checking part if a param is passed). I do wonder what the documentation would look like as it would leave it as a function, but one with a special status, in that there is a native constant of the same name which will enforce the same behaviour. Smile, Juliette --------------080202020006060304010802 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit

On 24-2-2024 3:47, Gina P. Banyard wrote:


On Saturday, 24 February 2024 at 01:57, Juliette Reinders Folmer <php-internals_nospam@adviesenzo.nl> wrote:

Hi Gina,

I'm not sure a pet-peeve is a good motivation for creating an (I expect large) breaking change.

The upgrade path, I suppose, would be updating calls to `die`/`exit` to always have parentheses ? Or alternatively changing those calls to new throw expressions ?

While that shouldn't be that huge a problem for real codebases (and would be auto-fixable for adding the parentheses), the bigger problem I see is the huge amount of teaching materials, tutorials and blog posts using the versions without parentheses which will now all be invalidated. I think the pain and confusion that will cause for a change like this, will linger for years and years.

Smile,
Juliette


I didn't actually know one could do exit;
But like I said, it is extremely easy to support, and the current PR does support it by hooking into the undefined constant code in the engine.
I don't have strong opinions about removing support for this.
However, I do have strong opinions about changing the type juggling semantics of exit() to be the usual ones, because the current one is just confusing.
I am also not sure what would make this a large breaking change, as changing this from a language construct to a function provides us with more capabilities.


Ah, I think I missed the part about the syntax both with and without parentheses still being supported, with the "with parentheses" mapping to a function call and the "without parentheses" mapping to a case-insensitive constant.

In that case, I don't see a BC-break and I would regard this as an "under the hood" change with only a very subtle, minimal impact (the type checking part if a param is passed).

I do wonder what the documentation would look like as it would leave it as a function, but one with a special status, in that there is a native constant of the same name which will enforce the same behaviour.

Smile,
Juliette



--------------080202020006060304010802--