From 1cb8a8d5a9a7ce5dff70227c4e2a9e8f35969948 Mon Sep 17 00:00:00 2001 From: xtex Date: Tue, 11 Feb 2025 09:52:39 +0800 Subject: [PATCH] Fix PHP 8 exit status cannot be null error in PhutilArgumentParser Summary: Passing null as the first parameter ($status) to exit has been deprecated and leads to a PHP error. Closes T15990 Test Plan: Run any bin scripts with PHP 8.4. `bin/arc version` should finish successfully without PHP errors. Reviewers: #blessed_committers, O1 Blessed Committers, valerio.bozzolan Reviewed By: #blessed_committers, O1 Blessed Committers, valerio.bozzolan Subscribers: aklapper, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno Tags: #php_8_support Maniphest Tasks: T15990 Differential Revision: https://we.phorge.it/D25869 --- src/parser/argument/PhutilArgumentParser.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/parser/argument/PhutilArgumentParser.php b/src/parser/argument/PhutilArgumentParser.php index 1d6f3a23..d2b662df 100644 --- a/src/parser/argument/PhutilArgumentParser.php +++ b/src/parser/argument/PhutilArgumentParser.php @@ -491,7 +491,7 @@ final class PhutilArgumentParser extends Phobject { if ($workflow->isExecutable()) { $workflow->setArgv($this); $err = $workflow->execute($this); - exit($err); + exit($err ?? 0); } else { return $workflow; }