Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:124790 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 02E5D1A00B7 for ; Mon, 5 Aug 2024 22:55:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1722898656; bh=TaOhZURrE7BWmcs6mBjfrViItskHqGT/LuDzix0IYDY=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=LIA0kaj3F0rAm9Ca8vRA/XznNt1CZaBmLttMI5rhoEt+MnFhItLRFIc0M+C0uLkSU mZeAuMFw1l1yBGghXxnVC+C3qIzBBPXiYkEsk+RfqMeAaNpAQfHqlXIL5yVZgwR9Zv cc7QiM4EgZHwrUWu6IQacRYbbquiGwPun6wrREECjSuNsCDgvlapOj7Q8ArdGu3UZ0 zZ1JRWdziM9Pvw+dBK1wFdAaUza4AoLXiC4weIPvqN1cMMeN7QzyzYfB+N6ZznaywZ KaAh88cTada0KouKdNjjFl2TLxC9RhSfe5YxOFL1sOzVU9pvqdMaQ+AmT8hDWpPnpS byndfglmY1Rwg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 9FD77180054; Mon, 5 Aug 2024 22:57:35 +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.2 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS; Mon, 5 Aug 2024 22:57:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1722898548; x=1723503348; i=cmbecker69@gmx.de; bh=7qbsUZg+jjaJKiqJpr63d3QbJ+ehA8n4EBVPC0TIm80=; h=X-UI-Sender-Class:Message-ID:Date:MIME-Version:Subject:To:Cc: References:From:In-Reply-To:Content-Type: Content-Transfer-Encoding:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=HxAL3KM+pznl0lMowZOsSdXYC6m+Ew3Zi/9EBlphmkJ9Z4mnEdm34p6Hy1eY04i3 wCPLTpbR00kNVR2SDSoISOcFZJhc+G0H+KQEYZBYzHgniW8ECxXpYcZorF3HH1yLG 0d8vi3iyCYNAxU8bhcotShHihdq4KD0o2YUK7ZIErDHI8ZScbYukbMBddlfMJbN1c 2wFdyd3ZgAum2e9nuXDIG2iplF05x5EJ4kvg+WiEGiSSXnvqrmLqm1XdHLG8AaKzd mWcXD0XGI2pbXmD5gRBdy8yYDR+09UXBAGmBGk76EFml86kifb77pjbCnpe0xZ2Bm xGPfsU2AE2DCxmlgcQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [192.168.2.130] ([79.251.205.37]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MQvCv-1spbKF3FkF-00X8WJ; Tue, 06 Aug 2024 00:55:48 +0200 Message-ID: Date: Tue, 6 Aug 2024 00:55:48 +0200 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PHP-DEV] [RFC] [VOTE] Transform exit() from a languageconstructinto a standard function Content-Language: de-DE To: "Gina P. Banyard" Cc: =?UTF-8?Q?Tim_D=C3=BCsterhus?= , Derick Rethans , PHP internals References: <15bb76a0-cbd7-4145-b429-76d424755106@gmx.de> <1a8650d2-7eb5-d645-8132-e5522ad24637@php.net> <06ba1d82-6387-46ac-8be3-1d3472993e1a@gmx.de> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:Te662yZFfkLoP2htQPjvONGAfD+HwJRVLMsupNzh6gh5+wbm8if /etFjVxEydYKlW5IbnsLb5McwRwpZx29sHTA/q5P9/AVXVzV8sXVJ0LfZypZdF5IVSOmNBV 2vkZ8UVUhPQt12UA3cO5jP/f9e8t4/EezXH8adaHKQADsECNZFnMBcgA5vwwvrVC4D4I83R YbZaTyfdtlLzEBWql/41Q== UI-OutboundReport: notjunk:1;M01:P0:A2NxilRD1oM=;3tOlbFhNtgD0Wm3/8b5A6192l+x 7CHoquWOqAKdu3TyoB8Hw6PxRTd+jYY0heZdOy/a8mf9sFPSO4uOrQCTrIP+Etq8LAC5MVVTN IGfvlfgUralyFvrtiMZTDhpTInKFuL1objSymxP88hx4zOH6cwIdfySZ1dWbKqJGy+a2Y1ZO4 peYhlb6SjbArYxzQK936KHD9kLcdSiFIZd5RmyxkCQ8pEkTGEuGXe6yTJkXqw9TzSmoNLnDKn Cdzh99L9ELz4fLv6IOEfqjx06VItBnt9CkvRXXBsxKi6833wzigaQGBOV8W38+ss+QNr9NZQl DrXYL/DlblxNy9aq1aX5CuVhsPUGncyFCtvrZEkVKUHVnu0V13C5tWFmqyBTZ+soRmseBXrQ6 kXg0UHiDqZDNfbOzBrkYscSC4CrGup6mm2BBpwKUnruPkXMUxyT6jHTzHt7wTjQl3rfFYOc+J wXcUlLr0mgMFh4VOhI58Omx5gRI+kocWl+yqxtgL5V24oWsRUv+9cSaiwWegUlkl/+1IBfoyI RI1E669eFLo7baJkiM3gfHYibBQKyBmsQ5DhSH/bWIhWKsrZjhA5zr6LLbPrFX2BJLiFkFSZo o13x5mlfgN9zsVd6ZJjzauwnRkgfdia4dYY1swP+WGP0HxrGdkuObD1pQ6MNdztnXAL+Of59n okIjgtBXnft9PkMvm/kE4wYPE/6qkDGNuRvWIfACcHx2Eg6Z2nynaddWHUQ3AZfywjvhCMyGo imOSZjAcmT6m0T0Y3mGzRRGwN8gBXQDmvN50Jh0NGb5iFBKcqyCvvOAXVznwQGOWChVdS6rIM IvjZHn+Hb4H0JWGgSYe4sPj7pOxl6KKmlYsOQrLtDPCao= From: cmbecker69@gmx.de ("Christoph M. Becker") On 05.08.2024 at 21:37, Gina P. Banyard wrote: > This sounds like a uopz extension issue that is easily fixed. Most likely, yes, although still somebody has to provide a fix, and someone has to do a new release. > I am not sure why we should bend over backwards for extensions that allo= w to break usual userland semantics while preventing userland behaviour to= be better. We shouldn't do one or the other without having weighted the pros and cons. So what are the pros regarding improved userland behavior: * we can use named arguments So we can now write `exit(status =3D 1)` or `exit(status =3D "some error message`). I don't see any improvement using named arguments for a single argument function (maybe unless it is a boolean argument). And for a string argument, I don't think that `status` is a sensible parameter name here. * pass to functions as callable That might be a nice feature, but at least I have never seen the need to pass `exit` as callable. And it wouldn't be hard to define a wrapper function (e.g. `my_exit()`) if someone really needs to pass it as a callable. * does not respect strict_types and does not follow usual type juggling semantics That *might* be an issue (although I've never stumbled upon that), but it seems to me that this could even be handled in the ZEND_EXIT handler. Perhaps I've missed some pros, but it seems these have been the ones the RFC explicitly mentions. So, what are the cons: * removing the ZEND_EXIT opcode That immediately breaks any extension using it. A quick Github search lists 3.1 k occurrences[1]. * making exit a "proper" function It still can be called without parentheses, so I don't regard it as a proper function. It *might* even be confusing to readers ("oh, now I can call a function without arguments by omitting the parentheses =E2=80= =93 but why doesn't it work for other functions?"). And the PHP manual even states (emphasis mine): | exit is a *language* *construct* and it can be called without | parentheses if no status is passed. Weighting the pros and cons is left as an exercise to the reader. [1] Thanks, Christoph