Re: [RFC] Transform exit() from a language construct into a standard function

From: Date: Fri, 10 May 2024 16:31:34 +0000
Subject: Re: [RFC] Transform exit() from a language construct into a standard function
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-123302@lists.php.net to get a copy of this message
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

« previous php.internals (#123302) next »