Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129995 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by lists.php.net (Postfix) with ESMTPS id E8C2C1A00BC for ; Tue, 3 Feb 2026 15:13:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1770131614; bh=8Oj7YaO+iH4wF5tOuGmSZ7B3XDr5snZFJFycyKIpJgk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=PXewuMagOcntitl6J+WqFC8ZiAOHmOUZT6pv3YOxzRc/qKBanzqNCh4aNgw0M3sM1 7vVtr5wOlYnJuqCMPjSJHHytGlGw+69UdASkH8UiMYcehqbFm/Tv6G9r2Tmlym3Z3E 8QEpgJuEU8E0tgGOjZXKfAwe3E6v+O0mYTQFyMpmn9zTEN7tzcFwr2wznuZlq+zXaw aLz45rL0/KpQfOre/oPKg6l0dK8WyXxvxId4B4v7wIcNkujiY5Fi2C7XJ0C3lImSwP 0qzjUzcQfE5wioE/WWGaXylOE2bwQQ1yB2TRhvse9f4JSdRD42brNDKlpvzGvy5c+G Kzu8nD8xFOcnQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 261771801E6 for ; Tue, 3 Feb 2026 15:13:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from chrono.xqk7.com (chrono.xqk7.com [176.9.45.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 3 Feb 2026 15:13:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1770131606; bh=IPTYszw1Fjbvckd7kyhJQYOKzefh6A1RbR+e9Qie0rE=; h=MIME-Version:Date:From:To:Cc:Subject:In-Reply-To:References: Message-ID:Content-Type:from:to:cc:subject:message-id; b=f2Q7N3fBR3JtCMS+VS1LpaTqKdXCyhC8cJEdZ5RsBoJTCHjRp91Li5SG86T80o63B S8vcTfRKfwN++dr36V6Pjh4JXlLHwDb7pDTFwFa+MZG/Lm7RC0GMHTXqF7X9OHPANx 4dRmJkzVeceB75UR0QAS6MP4jY1yL6508MJAdbQSf78JCH/PS8bVarVnyRUiZFILrJ /eK12Q69W+/v9mdLTDJa9R5qpofFO/7LDimsISOa2V7m2pYMz0PLe0crK/hKPWVrD5 +iVc0ndkFqYYOhcnP+5zMIgIdgDRmjhNwokf+iPStmddvA5CGblkkoNlx0YjVCRb7Y y5oI+W4M1BI6A== Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 Date: Tue, 03 Feb 2026 16:13:26 +0100 To: Vadim Dvorovenko Cc: internals@lists.php.net Subject: Re: [PHP-DEV] [RFC] Pipe to return In-Reply-To: <53c17181-caa4-41a3-b4ab-93069e6bb47b@gmail.com> References: <53c17181-caa4-41a3-b4ab-93069e6bb47b@gmail.com> Message-ID: <7351ad2ea062a074a94454257a241049@bastelstu.be> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit From: tim@bastelstu.be (=?UTF-8?Q?Tim_D=C3=BCsterhus?=) Hi Am 2026-01-31 06:52, schrieb Vadim Dvorovenko: > Introducing Pipe to return RFC > > https://wiki.php.net/rfc/pipe_to_return > > In short, RFC proposes piping expression result to `return` to be used > together with pipe operator to reduce cognitive load Thank you for your RFC. I appreciate how well-written it is and how carefully you followed the suggested template. That said, I agree with the others that I find the proposal a step backwards in terms of readability. Having the `return` at the start of the line is a clear indicator that the function ends there and it is only a “single bit” of information I have to keep in mind while I continue reading until I find the semicolon ending the statement. It is also consistent with how assignments - the other primary use case for pipes - start with the target variable and the equals before the “pipe expression”. I think it would not be wrong to think of `return` as “assigning to the return value”. While it is true that no one is forced to use the new syntax, I will inevitably come across it in libraries that decide to use it, thus I will be forced to know that it is a thing and to understand what it does. And of course all IDEs and static analyzers will need to learn about it as well. For these reasons, I don't believe it meets the cost-benefit ratio. Best regards Tim Düsterhus