Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129971 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 348211A00BC for ; Sun, 1 Feb 2026 07:10:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1769929825; bh=I0LZhYU7xJjXoPib9QMabua29kIbx02PrX8uq8qplYw=; h=Date:Subject:To:References:From:In-Reply-To:From; b=oN5tVyzxnrQ/XkVPlzMxWOpl7WtcqODlBonuAy8R8R6QQ0zVdvfPCzhHN0aWEDFHJ 7ifekFp29bNL23abpM69/I8Eo/JMGaJ398ZM1bKqhUDAPv4vM1h51ZA1hamuIaPSXM SLsuIjzAiLOFkb8P7B8PYy59kerWt73SCXYdRcl0J5Jyylxpg8eb4VwfISZ5BssbnQ G37nCQ7oCK/8EABOj8phNZQr83xEVtz9tj2h6R8qBOtXIbjq75oneDbvA+10t+f/1K yPiwJ71ieksyp3SWmwL2Gy6se6sInZZEVbQRkeUpIEMNy5iFo7whKi4z8Qn+u3ERWv 2spXNGXXz5qCw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id DDB43180069 for ; Sun, 1 Feb 2026 07:10:21 +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,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, T_SPF_TEMPERROR autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from mail-lf1-f53.google.com (mail-lf1-f53.google.com [209.85.167.53]) (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 ; Sun, 1 Feb 2026 07:10:11 +0000 (UTC) Received: by mail-lf1-f53.google.com with SMTP id 2adb3069b0e04-59b672f8ec4so3869153e87.1 for ; Sat, 31 Jan 2026 23:10:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1769929805; x=1770534605; darn=lists.php.net; h=in-reply-to:from:content-language:references:to:subject:user-agent :mime-version:date:message-id:from:to:cc:subject:date:message-id :reply-to; bh=qkeir6YTfESlSQMg85Ep94D54wITGxuVVK0Y5HVSU6k=; b=dMC+YS5c3XLfbTc25HTNPLJgA0DYVvHc0E7AjscAcxIhmxJDdsJjUIPMiu8Wa9B8P5 QhM2m5yXyrH07LWUM4YDeokjjDWQOHk2GveSbJyEgLuOEi4WejumM9F8Lt+dSytG7nNv TSvlEeZMmU6XclxMxwLpSItAhkz6ysbmAczCYiu4/JhKXfo7WMEsj5fgKUoZ/ARkh3cO pxzUpDRRbgGBVET106p8pRmZRz3vb8tNUoYFTcxG7LA7s5UoNrEqXA8G32TCGrQFwnPi 0odq5S2qGvqc5b8YyZHaBha2wjurYpOKonF959pywydNwajF5haJxFIdPCPkWag4g/DW fHGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769929805; x=1770534605; h=in-reply-to:from:content-language:references:to:subject:user-agent :mime-version:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qkeir6YTfESlSQMg85Ep94D54wITGxuVVK0Y5HVSU6k=; b=c5xd9XUqYZLgLvzcY8Ny+D1QWmt0BV+PFK8EfTLFxt802dp34vkqsPl1rlSmF2ErZQ pL93rS73OZvZc96Lonvo6cKKmCNUI0e8sadHzyoiZnrlMBDgpU2cNcSO2BOrXb6HHO47 D8G7vUt6mkRptjRdbqxNqDT/mS4KOrB84xqaAf9C9zLaI+PosHmg5fHSFXfxv7C3JMRZ bVSDLjwRlKhM9ThNhREnEPmUgqVnaWTAPY9gb2RCAyOLY7/CK9zJpQpwEjZPri3Z0yFt m2YmxqKMkNqWEOzYyufEybgHUZ8pUY1HevVKcboJzxEb4YJtBP/eOvAtnNyaKh1pn1eo Ssqw== X-Forwarded-Encrypted: i=1; AJvYcCV1SmfxcKAd7nfIcNcBrBhynFqbup/m+4YW5/Ms1pbVrwQ7btCLMgv5vVX9Szd4TNsT3iSrCfiz65M=@lists.php.net X-Gm-Message-State: AOJu0YxxYv+JcANIZmMTStxuIfrRIfWedY7tm8PqvTGDIhz9gY5I2OEo 022im8lnfqX1DFuTHYBDtVwps/anrtXFXZVrveJDrjm4twuNzcflwMQN X-Gm-Gg: AZuq6aJAOVD8+rHu+CFUTgVZGPxpKfAbUnHf3lg5noaojgI2Pz7cXVLEQ3dQzRC8LWp jpxPx4F1GmSveiAv2shSn1EiSlskjL8syB1TKbvIyW+CE9N5UdQ0c2Rf73bBaFN9JWLsUy7f0/T oAnQZeLsq5xrJdjCbamC6FF/WyFDhGmyVtafawR3W+TMQ1jS/Z2l98aINdExqjfzT8xRlZi55qy 4TwhRuOCPXwDGEyLPZcBpN8+2qhmEx2I3xCsDKZAVVNoCJoQFpWivFWPd0DkoffdkbMn502+OTQ pajxSTgk95oiElMAoEMSr+8NhOIwsiWYonXsymyxLUJHi67c2nh+tZiXdPusbFupJKlQNmF4b/E W9wFkeCx0PIaOwDAvEs+ggzufgzLX65gcZ93Fj3Yl2XVVDKwsFe3K23pekr+49OayM7y1K3ZHxO 4JEQBWQDdy/pkb0wcECkt6Ug0= X-Received: by 2002:a05:6512:2251:b0:59d:f28a:be11 with SMTP id 2adb3069b0e04-59e163f54d4mr3299895e87.3.1769929804540; Sat, 31 Jan 2026 23:10:04 -0800 (PST) Received: from [192.168.1.16] ([46.181.226.137]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-59e074b2bb6sm2777403e87.59.2026.01.31.23.10.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 31 Jan 2026 23:10:04 -0800 (PST) Content-Type: multipart/alternative; boundary="------------t078MAc5AzpAKNl6gJjwLrrt" Message-ID: <5188027e-39eb-4bb6-ac1f-83223c47eaab@gmail.com> Date: Sun, 1 Feb 2026 14:10:03 +0700 Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PHP-DEV] [RFC] Pipe to return To: Jordi Kroon , internals@lists.php.net References: <53c17181-caa4-41a3-b4ab-93069e6bb47b@gmail.com> <019b55a4-8d06-4d88-801e-c3c2de597f1c@Spark> Content-Language: en-US In-Reply-To: <019b55a4-8d06-4d88-801e-c3c2de597f1c@Spark> From: vadim.dvorovenko@gmail.com (Vadim Dvorovenko) This is a multi-part message in MIME format. --------------t078MAc5AzpAKNl6gJjwLrrt Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Jordi Kroon: > function giveMeFourtyTwo() { > return 42 > |> return; > } > ... > fn () => 'hello world' > |> strlen(...) > |> return; Thanks for examples. I've already had a test for first case (https://github.com/vadimonus/php-src/blob/pipe-to-return/Zend/tests/pipe_operator/pipe_to_return/two_returns.phpt) Now i have added test for second case (https://github.com/vadimonus/php-src/blob/pipe-to-return/Zend/tests/pipe_operator/pipe_to_return/008.phpt) to be sure it's not valid and cannot be accidently treated as returning of (fn () => 'hello world' |> strlen(...)) from function as callable -- Vadim Dvorovenko --------------t078MAc5AzpAKNl6gJjwLrrt Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
Jordi Kroon:
function giveMeFourtyTwo() {
    return 42  
        |> return;
}
...
fn () => 'hello world'  
        |> strlen(...)  
        |> return;

Thanks for examples. I've already had a test for first case (https://github.com/vadimonus/php-src/blob/pipe-to-return/Zend/tests/pipe_operator/pipe_to_return/two_returns.phpt)

Now i have added test for second case (https://github.com/vadimonus/php-src/blob/pipe-to-return/Zend/tests/pipe_operator/pipe_to_return/008.phpt) to be sure it's not valid and cannot be accidently treated as returning of (fn () => 'hello world' |> strlen(...)) from function as callable

--

Vadim Dvorovenko

--------------t078MAc5AzpAKNl6gJjwLrrt--