Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:123444 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 2EC341A009C for ; Tue, 28 May 2024 11:58:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1716897591; bh=4N9BGx2PiV+yjeWKlXrVDCaComPmNm74tJIgVZIE+C4=; h=Date:To:From:Cc:Subject:In-Reply-To:References:From; b=OpjiSleLYe7hDLWmG95Kd2Ws0nJtStXquLNq8n3qO1bX4gI+QODOBk2h05QUn30lD HdPMljYPFfkL/IIwDcNx963PwGYasJXwTLXL9W2E+yjDniTKS8TMCZJTuwShO3ZvBa KjnGc7yfOsejT+KdM+mQz+qTmOT+YymQkMOz5f9Axq0OmONxOMT2+5H20Vb7QIbKPq WYtoXVq5NIhUybfxAneh9qYM5zaCB5YX31DRDWa/vVQoJJPDk9Ho8tCzjR0BJJUtCD GrakRLThM1XNTZ9/EUFFS9OiZXo52l5/AKlweYnqfGjsXIpWz2qibIapEqCMwTjr3m O2iF/G8JbgHZQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id DC5D518006F for ; Tue, 28 May 2024 11:59:49 +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.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS,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 mail-40136.proton.ch (mail-40136.proton.ch [185.70.40.136]) (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 ; Tue, 28 May 2024 11:59:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gpb.moe; s=protonmail; t=1716897527; x=1717156727; bh=4N9BGx2PiV+yjeWKlXrVDCaComPmNm74tJIgVZIE+C4=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=Dl6Z545AD9aXW6H8DuGFlNr68erP+yyhDteia0SjpibyNnPeZvp8NDmoFgY0PZxmu +s8Nhuh3J+0HH2lw9k1Fm1TZmiTvKIblDLLWh5PcqUh0YaSD4NtZHMdycbu7IkzIcb Ty5esmbBJS9QHrDqSy8hPKz/8JWm73D0aHGCzTbV4SoxxrF7XDxP24S7gk6tOSJr4y WN7mheCLsDJJtNQRDxrfs1kKhABvxMOOyj7k1GDjtXXTyayEWP9Ydw/pjvoksxg9wK VEmiM+gF2i7oLqayGUdmzz+VGiEW3Mkng8SNULR1Z/CsjW97M2Vg5qmYizoQc8vU73 iFaQY0CnfBdng== Date: Tue, 28 May 2024 11:58:43 +0000 To: Daikaras Cc: PHP internals Subject: Re: [PHP-DEV] [RFC] Transform exit() from a language construct into a standard function Message-ID: In-Reply-To: References: Feedback-ID: 96993444:user:proton X-Pm-Message-ID: 35e1768d84c19695b9b77782e55a23e08b776978 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: internals@gpb.moe ("Gina P. Banyard") On Tuesday, 28 May 2024 at 07:53, Daikaras wrote: >=20 > I feel like the reasoning in this RFC is misguided. `exit` behavior is > not consistent with functions because it is not a function. But it is > consistent with constructs like `echo`. Or am I wrong? I'm all for > stricter typing but not at a cost of reliability. `exit` IMO should > always terminate script, no exceptions (no pun intended :)). Otherwise, > it may have security implications in some codebases, as Saki pointed > out. So I'd rather have it error fatally like for example `break` does > when passed non-integers. And on the same note maybe syntax could be > improved to not require parentheses when passing the code (so `exit 0;` w= ould be valid) since it seems to be the cause of the confusion. >=20 > Just my 2c. >=20 > p.s. In B/C table you should mention that passing Stringable objects > will throw TypeError when `strict_types` are enabled. This is not the cause of my confusion. If you had read the RFC carefully, you would have seen that exit() already = throws a TypeError that can be caught if you pass in a non-stringable objec= t. So the argument that it should always exit is invalid. Moreover, in other programming languages exit() is a function, and I don't = see a reason for having something be a language construct when there is no = need for it. Best regards, Gina P. Banyard