Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:123302 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 A54B51A009C for ; Fri, 10 May 2024 16:31:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1715358747; bh=qrP2j1/wlWEHBo+Q4w5hfk+91I8wimqvlunKTNudxU8=; h=Date:Subject:To:References:From:In-Reply-To:From; b=PonpeshEX0KEU2Rh8TGg26tG5ycU0u9tjglzstf3IOLuXmDrVpNXtr9kAz+1bHaFZ iW/srE6e+GgehTv4/abYpuhu3FBB5zyJ/yzY83Yvno8aD+04heak256rQDzUaTwJsV e2rS+9IS9CqpzWNG/bohbrMBM/f/2/NMYzjsf5h8pzJvpPY7hR4fCIQLQwaw9MBXRU jza+dGWuoqeKEE25M4LDjO879oaEu3WZyZDnVIDXk1LXSPPwgQLdVFPi+qFT0Yrbde QGSq9cZOI3nzeSGr6ZTz4ljtKA982sigaEdiGsfeYqkVLdw44ejEpezp5fKp+6ErUE QqkmPeZRbwaSg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 73F2D180057 for ; Fri, 10 May 2024 16:32:27 +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,SPF_HELO_NONE, 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 chrono.xqk7.com (chrono.xqk7.com [176.9.45.72]) (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, 10 May 2024 16:32:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1715358696; bh=ASoy9gzyDMX+cAzGKmSDQmp8RCswurk07fRCltjs7mk=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type:from:to:cc:subject:message-id; b=aMyYcWpzdju1GBc5g/c+GQ0TiFCbkXgXjYOZ5ty+3T/3Z69tGm1Zz23gYcGtPeK9u GG1RAMjWD5X33aSyrA+iZNG70Lq6TCu4LmF4aOWQvzF4teVRyNom6v2csqleo3cZ21 YREmAmsPQ6MymWkGMGM6MM6SX9k4DfGu/aS6+y7EDEeSklIhX4P/wtMIt1tzb6fRE4 +O5a6I1kVA30b8MwxX3THnK3KkI88t0PRmrbCfl+B2Q+/2LvK7g//VWiDRlTlX8Ek7 6DZkVlr7qNwE6y3BkcaE65YY9pJ6awmUGTzi6uG8ksGpSkslHPX/ctQeO2+HRMfpVC H3QHn02iO0PvA== Message-ID: Date: Fri, 10 May 2024 18:31:34 +0200 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 Subject: Re: [PHP-DEV] [RFC] Transform exit() from a language construct into a standard function To: internals@lists.php.net References: <98b2b3c7-9fc7-4832-8b70-93c432b334eb@app.fastmail.com> Content-Language: en-US In-Reply-To: <98b2b3c7-9fc7-4832-8b70-93c432b334eb@app.fastmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit From: tim@bastelstu.be (=?UTF-8?Q?Tim_D=C3=BCsterhus?=) Hi On 5/9/24 16:27, Larry Garfield wrote: > I support this. My only question (which applies to current exit() as well), is what the exit code is when you pass a string as the parameter. That's not clear from the exit() docs currently, but the RFC made me wonder. (This may be just a doc fix and we move on with life.) > If a string is passed, the exit_status is left untouched [1]. In practice this should always result in an exit status of 0, because I can't see how the exit_status would be non-zero before `exit("foo");` successfully executes. Best regards Tim Düsterhus [1] https://github.com/php/php-src/blob/f88fc9c6e8262fe48eb9cf078e32e63af19047f2/Zend/zend_vm_def.h#L7541-L7570