Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:116439 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 60494 invoked from network); 18 Nov 2021 06:51:27 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 18 Nov 2021 06:51:27 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 188741801FD for ; Wed, 17 Nov 2021 23:46:51 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.2 required=5.0 tests=BAYES_40,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS14061 188.166.0.0/18 X-Spam-Virus: No X-Envelope-From: Received: from server1.lucapetrucci.net (server1.lucapetrucci.net [188.166.53.163]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Wed, 17 Nov 2021 23:46:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=lucapetrucci.net; s=mail; t=1637221609; bh=y3oRsu4hrkO5BE2XszDEkLUI5NT3eCQB4ySaidech+E=; h=Date:From:To:Subject:From; b=B/eR4sHkKzDcyYPyKC5D44V0884wz3gZJLtQkFSwoy+ZQQeFBJI1pMAbhtGMovlZy Ri4ySpYut53gEiiZehbQAXjWzJIyjwRN7o8RlXEO2vrmkFP4An3Idy/VQtiAw6u72V v3zXpWgUM1orDyOn8hN8jEqNjUfR+KtCAXeV0nrj14T1dsEHDi3zAxspO75s/LLbpN AYjMeogL8i2LTjv+4VNvASpv0Bwmvs7Rqtn0+g6AMVZma2rCbQeOht4QY4puM2gHQn IL5bUP9JKuUQJDM/LK0aqbxD6cykg0FsVtcmm/VMTSXahIiUCQNNr7LGsZiZl00A2P CtjpUrarVrMRQ== Date: Thu, 18 Nov 2021 08:46:47 +0100 Reply-To: Luca Petrucci To: internals@lists.php.net Message-ID: <20211118074647.muibn4mgfezzy75b@lucapetrucci.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: Proposal: &$result_code=null parameter in shell_exec() From: internals@lists.php.net ("Luca Petrucci via internals") Hi internals, This is a proposal to add an optional parameter &$result_code = null to the shell_exec() function. For clarity, the current signature is shell_exec(string $command): string|false|null The proposed signature is shell_exec(string $command, int &$result_code = null): string|false|null If present, the result_code parameter is set to the exit code of the command, as it is in exec() and system(). This feature request was also posted by another user on https://bugs.php.net/bug.php?id=81493 I have a draft pull request at https://github.com/php/php-src/pull/7663 Thoughts? Thanks, Luca