Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:116442 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 69689 invoked from network); 18 Nov 2021 08:33:59 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 18 Nov 2021 08:33:59 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 1D6EB1804C4 for ; Thu, 18 Nov 2021 01:29:24 -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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-ed1-f43.google.com (mail-ed1-f43.google.com [209.85.208.43]) (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 ; Thu, 18 Nov 2021 01:29:23 -0800 (PST) Received: by mail-ed1-f43.google.com with SMTP id e3so24138470edu.4 for ; Thu, 18 Nov 2021 01:29:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=aRwxyKeyJsopao8SECNPlHO9FWV+pBzZkPnbMJ0jOKI=; b=XKIosdPbLrzUQeufOKBxPtMrMJ+Y+lRWVEQDv30QUgdBQrh8tMLaBvBkqNSJWw7c6+ uGUpdD7bqwTZbJYFzYUhsI5/OkrpgYLHTnZ0PCf3CYYfovZH9syPWLtcemw8QAPs73pK cmuvIsq7i9hN3ptZZ0Q8FDkuVXjOKwweCfeNZOnsP9BL6OmtZn4Rz2N1P+KyIwqorQeD iU4bIMhwM4pHF8tA0LgoEZPcNMzXI0/D6DSTNo7n18vn+3K2jnLmLsnz7V2MVmv1nlcB TkvMcDyFwEXQXFXsO+RKBuf1dWnJcQP6LCI+/hiiQORSPgHnuJs9zmnXJ/KaQocVLcLp OmZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=aRwxyKeyJsopao8SECNPlHO9FWV+pBzZkPnbMJ0jOKI=; b=qek2k3JSjTM7+fWppGCX5YsxjkIx4/Z/kO09lAhMmDqVNBjcg70NSpFbOZuXG0IXHe 5mnhrpc4fRAGqUZN+RXj71WeaU1fT0MxoyoQRy6jK94cxuIwcdBnD//vgoLP+WRHGDoK aoZAGlPB6RIfizRvVsFFeZsohPyo4aemkYyCzFXv/T8zFOZAsF8R9Eqjav57jT9qPRU5 C8nYghCffdBmFLrWSWMAArZzd+Muk+T01dk42yti+Obt5XydXp+pkIx50WBdygd8Cci2 fH1OTyw8EF8KICqfPMnInr7eLB2Je8L6iO4lHXU/29tp8zhk2ipOD0wHfjAErpPCgAJW Etug== X-Gm-Message-State: AOAM5319Wx4+hKBbinisw1dN6JFEWhQAavatisPFiflappRZXYEiBGar KDoGi5crG+VaIZwCTuRzwRYP7gg7OAOXoUcBi1k= X-Google-Smtp-Source: ABdhPJzsw1A8w6rH2bNB8MxMZ3QqpT9nuqqz2bRa2ZLPf0z5z1USmi4I5mLHCFbCHcgF813RyCV9PzCaZTYWcMfAi6U= X-Received: by 2002:a05:6402:270d:: with SMTP id y13mr9252957edd.362.1637227762160; Thu, 18 Nov 2021 01:29:22 -0800 (PST) MIME-Version: 1.0 References: <20211118074647.muibn4mgfezzy75b@lucapetrucci.net> In-Reply-To: <20211118074647.muibn4mgfezzy75b@lucapetrucci.net> Date: Thu, 18 Nov 2021 10:29:05 +0100 Message-ID: To: Luca Petrucci Cc: internals@lists.php.net Content-Type: multipart/alternative; boundary="0000000000002e161d05d10ccb0e" Subject: Re: [PHP-DEV] Proposal: &$result_code=null parameter in shell_exec() From: nikita.ppv@gmail.com (Nikita Popov) --0000000000002e161d05d10ccb0e Content-Type: text/plain; charset="UTF-8" On Thu, Nov 18, 2021 at 8:47 AM Luca Petrucci via internals < internals@lists.php.net> wrote: > 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 > This looks like a reasonable addition to me. Between shell_exec(), system(), passthru() and exec(), shell_exec() is the only function that doesn't currently accept a $result_code parameter, so including it makes sense for consistency. Regards, Nikita --0000000000002e161d05d10ccb0e--