|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-05-08 21:44 UTC] phpbug at robin dot pfft dot net
$ php -v 4.2.0 $ php -q <?php exit(5); ?> $ echo $? 255 exit(n) always reports 255 (or -1) as exit status to the OS, regardless of the value it is passed as argument. The correct behavior according to the documentation would be to report n as exit status, or echo n if n is a string. The only workaround I could find is to use return from the global scope. Thank you :) PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Dec 17 12:00:02 2025 UTC |
Here's another workaround for you if you have --enable-pcntl: $ php -q <?php pcntl_exec("/bin/sh", array("-c", "exit 123")); ?> $ echo $? 123