Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:126515 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 qa.php.net (Postfix) with ESMTPS id B52411A00BC for ; Wed, 26 Feb 2025 20:01:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1740599935; bh=MW8rl1t1TxzlUWn9TcI7yIVbZXJpiC0u8pUs69oEUIk=; h=Date:Subject:To:References:From:In-Reply-To:From; b=hJreq4MT8kH9sCuHndBc79TVXWS4v3w95XgyBrex1wA3EKGOHn4MmWR4gsk8tRoA/ zhBfdo0zWYQTpEDFveLUMKyAaF4T2zTPBfrR4iPQiEyVWZR1VuYAPu/+ZlcwDtskCR znZ+Kp/1twL400el5JJi77PSANhZqTDb/tYqbm3XQHNCmTcwnBlSmgbrVNzzNyBeGd InEtyqnNvM7dDfkiR8ic7jLe3uy4sK5wfUcBm0yRwK9lD7miHQIyOm+RTadnr4yJz0 q1bxo+LEvQEc04LoVZRQEAXPDAf/pmdPKCNig1cAxXA3dP3EvmW54aGgnVEAKHIUQ6 +pCgwUcc2wQeg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 8F6A618004B for ; Wed, 26 Feb 2025 19:58:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=BAYES_05,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.0 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 ; Wed, 26 Feb 2025 19:58:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1740600089; bh=bXdcktXmGDhfe3eAlN2bAu/84h+3R32i+VR3vFDxI0M=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type:from:to:cc:subject:message-id; b=bO7DCp7GukoGQFyQXU+GQmZrfx08KLP0hYF5R8mcjNmP4u+tdJi7+ckjXFzP5if+o msU8Sjv1A79tZp0yCwasLdAL/UH3NOFtTNdelgrpMpMsTg87iMZkgjcXW8Ci2IO6Qf I+KZHYo50IFzesLtOZWYlgoUOsA3Zhr6R9lIPgUJ+9hDzzaJdpfiEX9FjXFxYFFZQD FpqPpN0UD4C3Y/psXyswJy5NaehpfErTTNo/YYbSIg911eVDb4Jgm/I2RgtnDWa0i2 rN7w7yGQluKd5ugBoIDHQGHHzKQPiAiLF3LMUpzzLrLPwR3AcX2she6UV/SVmOznXN VwBTBgwSMV9bQ== Message-ID: Date: Wed, 26 Feb 2025 21:01:28 +0100 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Subject: Re: [PHP-DEV] [RFC] Pipe Operator (again) To: internals@lists.php.net References: <5a584219f120385e7e30f6d0a46cc108@bastelstu.be> <1b8840b9-5ae0-40db-8af2-521ac5888c7c@bastelstu.be> Content-Language: en-US In-Reply-To: <1b8840b9-5ae0-40db-8af2-521ac5888c7c@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 On 2/8/25 12:36, Tim Düsterhus wrote: >> If the expression on the right side that produces a Closure has side effects (output, DB interaction, etc.), then the order in which those side effects happen may change with the different restructuring. > > That is a good point. I see you added a precedence section, but this > does not fully explain the order of operations in face of side-effects > and more generally with regard to “short-circuiting” behavior. An OPcode > dump would explain that. > > Specifically for: > > function foo() { echo __FUNCTION__, PHP_EOL; return 1; } > function bar() { echo __FUNCTION__, PHP_EOL; return false; } > function baz($in) { echo __FUNCTION__, PHP_EOL; return $in; } > function quux($in) { echo __FUNCTION__, PHP_EOL; return $in; } > > foo() > |> (bar() ? baz(...) : quux(...)) > |> var_dump(...); > > What will the output be? This is unresolved. Best regards Tim Düsterhus