Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:124686 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 C1E961A00B7 for <internals@lists.php.net>; Tue, 30 Jul 2024 12:50:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1722343949; bh=AEen63JZmCouO+/8GJyGvE2qyuvyJgt2JxAUeiGuUok=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=k9HexdlSUSouCTDIS/hL+K+/QcAn4uz+sIG8MpFaF0hRaYZLCGnmyhEAO35zgzDUQ msgYE56biqEuOJlyv2LXHYTy952CevURnPGzrA65+Spyf+jG0/uB8lHypk1Ofa/WiB hbEh9VGAB1ckT5yhNsmZAHHtFVIBUVugoqQdUqt/QoZa2ArkqrXOts06bp9+Ex/FHY BIysHoS7FqS+WQUnPo85xNZwdsF8I9h1ePEu4ET1DFyuDbV+qod+CnkmyIw+NSEDqh OzYGZ0mD0CBBfWohylZ4NQ6k1kctWXoVnN0eHqdAim7mOXUQiXNFIXtdO2XHSaRvTT GCVvNXIm32HnA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 643A618007A for <internals@lists.php.net>; Tue, 30 Jul 2024 12:52:28 +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: <cmbecker69@gmx.de> Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) (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 for <internals@lists.php.net>; Tue, 30 Jul 2024 12:52:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1722343846; x=1722948646; i=cmbecker69@gmx.de; bh=AEen63JZmCouO+/8GJyGvE2qyuvyJgt2JxAUeiGuUok=; 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=Vx7UMst49Ej6tGQaRrCR8g8g+FRhZnmG/a6oxjJY8quZSKMO/qMmrityE/wr062j cLWWvUUInPwH6vfPmw8mbVseaToYQnCpWY2bsJGBQr9F9R0ByFdYJLoVUlRaDXUEj wFByLzP3zJq3hQQeQVjBK33UlQ3Y3j8li2FTYYE+bjoQJ42XEnZn8R1Wkq8jqmIW4 A+iBYxuqfhAAs30GxygVVKdE9Qr91CoNpC/C2qDjvgwqTJN1e7EjqS6r2HGb63qLk rXOazFbW2xV5YcUsRlpzOi/sZ7ucFbx+9q1r1hLOLsNPVpiQzGhVpgbuF1JokfgEI BP8apeH03GaElDRczw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [192.168.2.130] ([79.251.205.37]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MfYPi-1s1fUU2nvM-00bLwQ; Tue, 30 Jul 2024 14:50:46 +0200 Message-ID: <f3e0c630-f2ba-4802-97b8-52f7e8ea91b0@gmx.de> Date: Tue, 30 Jul 2024 14:50:46 +0200 Precedence: bulk list-help: <mailto:internals+help@lists.php.net list-unsubscribe: <mailto:internals+unsubscribe@lists.php.net> list-post: <mailto:internals@lists.php.net> 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 language construct into a standard function Content-Language: de-DE To: "Gina P. Banyard" <internals@gpb.moe> Cc: PHP internals <internals@lists.php.net> References: <WAN6ETlWt7JfcVoyeYfY_F_eLE6WzQa87F7yi8SHISmyktMYx7YcA6oG5dis3gFeI36VBjSfjGw4AT6psFFDXEUNRrvKRRn4LxfdCxFBccw=@gpb.moe> <15bb76a0-cbd7-4145-b429-76d424755106@gmx.de> <ZSpcYknK0LK2eKQgO6FM8LnZDvRY8bqQNLXjA46EoCqCdrqUS_r2IOVAEgc0BwFJS25emgnQHsULJNjAIpbs0PzBTaVdR9iIuRdQ-jcGvCc=@gpb.moe> In-Reply-To: <ZSpcYknK0LK2eKQgO6FM8LnZDvRY8bqQNLXjA46EoCqCdrqUS_r2IOVAEgc0BwFJS25emgnQHsULJNjAIpbs0PzBTaVdR9iIuRdQ-jcGvCc=@gpb.moe> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:dGEEpE8RNUyTgflIN3bXUv/6ghcdh7AoTHK/PxW3RGGkhyIPCX5 hJM7UG2DO6THMoes9V7BfHDggCI1F/H/5ENAs8bfd70VBesGS8qWc6JY6xeTObdh2lRpUh5 o+j9ymWQr4zIGPID65LlKehsGzh95aCRi/Aci6IPExnl33FVpjtWsNg5Udt0qqKBC1uJKYl R91L4XT5BbDDjtWA1kXcg== UI-OutboundReport: notjunk:1;M01:P0:ujc2tw3MDsc=;xuxmNb1s2gN/noTcXPknqcid4Kg cuSEONezIXZWZUFRfOFDhtFUjzoH+CcPw79MET3sCXoZea+XQ62NV2kFSMukjUOfIsscpEQVO hnXf8DsRgEJutgSegnRCSu6iL+u9m7ra1YcR4gfp08guTu/TYbc5U4fkMlnGc9xgxPlvmlNVj AmSit/C98OWRmN4Qb5puVN+/x17CDULHaUx/FRTzfNjvu3f2HcVzgRLrZLY89RMN1XBh++O3E fv1SpqPUPmTh0132JfjlDvUEM8D3vBCVylMy8ubbAwiDWppK4ZRMNNRt7TZ6Dn5p0tS6XQ5fG 24wITqDYzktTGDi5cUoMl59+ogKwyU479UqSXb+RAt5BoMhffT0GC4ekFXTENeq4ue3x4mz0N dSEiDB3HWriXkqw9WOuhqVxzTWXV6b76B4tg7Ez8lUmtiQaYZV9cuZhc+9orR1yfyaC4qf6cG eMPU34+jWAOoT2IXhJ3vF6ImyZxPlJWr6o0LmZoDoWkFz7VWRybTh2bo4vK8pE2z0Y4xw8VwA zxXVUS6LZAPpwcB3yCaUuOX9UqEp0f/3Xzc+KD4cbisugL8gab4ic1vTZiCLusqhO4QZ79f6J xgmBFVJhFzxNm7ExbiNwzVnRU6xNJ7uNlsPm3h7ftNAeOS/E/nWCkNabcYm21MzSAk26Xq+fp k0rm95+xdB7SnXaV0xCp++F4XMmkCLL9mb0rU58jpL0h5on3v+UyTYgLt4d3OIBOFG5/ydMIa owNu/nBp3sltjoa746hKuOQDbdpaZv9HKtknAZYi90n2EqBsFaRQp2tgCpHGmUv2OQq+XeBVb f6BYqWOI0rtH9gXX59USghLw== From: cmbecker69@gmx.de ("Christoph M. Becker") On 30.07.2024 at 14:30, Gina P. Banyard wrote: > On Tuesday, 30 July 2024 at 13:47, Christoph M. Becker <cmbecker69@gmx.d= e> wrote: > >> Would that RFC imply that I would need to write `\\exit` or have a `use= exit` clause to avoid dynamic namespace lookup? If so, I would be even >> less in favor of that change. > > No, since the new implementation where the token is preserved this is no= t needed. > You cannot define the function in a namespace, nor disable it, nor use i= t as a goto label. Okay, thanks for the clarification. > The one benefit of having it become a proper function which can also be = used as a statement is: > - Using named arguments > - Passing it to callable parameters > - Usual type juggling semantics Personally, I'm not interested in doing the first two points. >> I do understand your point about the type juggling semantics, but I >> might have addressed that differently. I almost always use `exit` >> without argument (and if, only with an int), and `die` always with a >> string (and only for quick experiments), and I figure that this might b= e >> what most contemporary code does (at least, I hope that the >> `do_something() or die()` times have long gone). As such, having `exit` >> and `die` as alias could be changed, sticking with `exit` as a control >> flow instruction, and having `die` as proper function (which could even >> be implemented in userland), where exit would allow an optional int >> argument (like `break`), and die() a required string argument. Of >> course, this would be a much bigger BC break, but it seems to me the >> cleaner solution. > > This might be a good idea in the long term to properly split exit and di= e and have them take only integers and string respectively, > but I am not going to personally bother with this, even if I think this = is a good idea. Fair enough. Given that I'm very late to this party, and that I'm not strongly opposed to the suggested change, I will refrain from voting. Cheers, Christoph