Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:130191 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 531C61A00BC for ; Fri, 27 Feb 2026 14:23:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1772202201; bh=ilin3ISkM+QaSU6RSmlmB4v2CJJ8sCtY7iyrbf2Hv44=; h=References:In-Reply-To:From:Date:Subject:To:From; b=mFXnH/JJ49U/KiukDv6SUoazT5i8eD5Gt1dk3OkzW1IwubkvC5XUTYStkNf6Dykit SFMsKL+k/9lEHfxiX3JDbX6NI1M+TFaBBhQtJcEXC6OzUAhhhrlCRQxvUJDAXr6bL0 U3dzbd6ngcN5SZgHZ5LWWR1rIeVCL51tSZp0zhLyFUoZJ5kurWmaw9UpXoAlQtpghH +Q56bopPPuTrUelXZ7ur8YcldFk9gWuDZ9QZHRnONo3JoDYqV1F+u6kiM7XAMRV+Mn +FvZB+p7+M7/rEHNZsjwxvQwqhhDSWsMeO3enrKAss88XMYiAEtf1QmuiJBYFG8EhQ MuCvKHdbOL0+A== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 56B5718038D for ; Fri, 27 Feb 2026 14:23:20 +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=1.6 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_50, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS, FORGED_GMAIL_RCVD,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from mail-qt1-f180.google.com (mail-qt1-f180.google.com [209.85.160.180]) (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 ; Fri, 27 Feb 2026 14:23:20 +0000 (UTC) Received: by mail-qt1-f180.google.com with SMTP id d75a77b69052e-506c02ec1b3so24151751cf.0 for ; Fri, 27 Feb 2026 06:23:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1772202194; cv=none; d=google.com; s=arc-20240605; b=ZHr2nY4gRv7w5VfVe1MvwADMTvRqAQQ6Az+sJ3HdAq0qSNCYjlcjIjP9aMAfrWgQ/x rUltXC6Sb5LFv+7GXxxqNtRdH5YlA3unrFkLQz03S2O27pmMLlpRMDgCdJLLaf/FuNOF YD/QyLpkvsJRCcKAbXG1LmIOZwtjwE7nRnlmrJTlRGVRofpZCwAPrFnrRC1R82I48e4I /1nI73Ky7e6RRwj1CDbW1lJltjxOXu0gpkWZ6sRbSE8W0PbjX3HxsUpqovwgRQX08xGz YPESwSGFJkiQS0td5jhQxRWQeD1+QDcT/PCTz2fZ/iTGu+2sF2PSF6xL3t0UbCffgHIj RZQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=ilin3ISkM+QaSU6RSmlmB4v2CJJ8sCtY7iyrbf2Hv44=; fh=PwvV1jWZOR90rDIG/6XexqaHJyAFBTdnFVhsS64qdEQ=; b=WjlWoeP1bfXXxxnwoaw+ruz6Z+gcg1mFgC63GiRojt3PYzj4heO/nZtCncUps0or6v KgYkzus5SHFj/M7hPLE5cp1kuVPxXNal5Skc/FoSlJk1hm/C+ZyzD4mNyDF9L4jnAOtS 1s5QgeGEPs+KPVeo8F/RWs9L5tOJ4Q8xBTKanzF1i30Hk5oQqFiQeCP5ZgJ26xEqbmcX p0xKIwaODsU61fEW0vEqkdkzQHz2tjYbomFNuPXQBTb2MQjdwqkwdUnBVrk38SzHQV1n pO6ecxcW3QYRRFzHWspVLZq7rZNt19Zu418GiO7qlnF9Rg3EOQZlnrmPyhgMaIAir89g v/1w==; darn=lists.php.net ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772202194; x=1772806994; darn=lists.php.net; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=ilin3ISkM+QaSU6RSmlmB4v2CJJ8sCtY7iyrbf2Hv44=; b=BS9peGc95/nbQBZtPulGGs90Py3HNSLkhSYqxdIDLQjmXzDoYc8uJnIdIz7SkiggnI HzL8J6/msERAk6Rfz+8CfUQ4I4B2924Ls2dh8mZJ4LoSOQgS97ofQ/0O2mBhcTpgF+1d AAk8o8SwMUf8sNK0r2+vUdeRyYmQ+XAZwZmpb2zwpU35Da9uPdI9trMlqmlL0zsL1sJU CuOmnm2BIF3eaBSN8q4u6Bey0jvYZG0Iza0BWI5MySSl2YhV4fD7gWHvpWbL9M7goBjv ZgHIfD8mcGjwHYLTlctR+HVAemSs4m8QshN32+/dkDiXyV/T9RmQiphCGDsfgb4ddZKV 6kvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772202194; x=1772806994; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=ilin3ISkM+QaSU6RSmlmB4v2CJJ8sCtY7iyrbf2Hv44=; b=W1qgTjQQ6hWglbMfURfoozx1VX3pN7c2xCuD3p4smezb98by+nueo33eYavCT8+ZAI 9wG0iGTByRMPwWBuuj2ery2GWzHJbbWTm6u23jbtvgom589PC9GMdz7HGPwszZG5VJ00 7zBdO03juzBBd51PZrF6VpPOyuRB+AuLTsr+U1RENmWyQiZZX454JOJ/1inDz66Lql8y L8dZ2Cnx3cucsKGbe7L/wqN6oHzAQZ5qBp1yQTMe0FXPytRJRohD+yh3tTXKv98GXsgB LfC4ygHDswALTw+7G8PPvA3SmVrIzrJ0ettK39d6H0CERF+tUZq/Sp9XILhozc5QmfbE M02w== X-Gm-Message-State: AOJu0YyV5mwsayyTNCqDbGDMs0+NdOucTST6941Z6pPfKKEL4jBH7/IQ NQ5BkVT6GyUjNBwBmUZ6XpgvRdXAkWwzE/ggXQXCmj7OB5fSPQXz2DP22GzHXFn18ogZ8YCdSxz FVbxaaYQGfSEbelqEqN7rfgoZ/qEXE20GxK8oFIKu3w== X-Gm-Gg: ATEYQzxdsVkd2pJZpp+V2nRLrH4+SCnI6JWrMnSlZxeb4FUoT8qSVYSorC3VUWPc4W7 ay/FJUDfarbJKYt5ppi4fh1yICp23zpAqGTyLMDIGQGCCbPau58GnddhDLRZqblWdm87YvgNiEX Y8mw82WYm4oaoh/U0+eECEVPxKI+5Axp8N5fz7oB1J4EfthpHZRaiDX7xCsRFakdZaZ0nK6U6nI b0TztTI6pxAQMIUio5TD1F+T2b9mFVFOCdFdeT4YH7xqoHTppkv0flIkfGVJpEidG+kFgbvUxH+ dWqamz5sTg== X-Received: by 2002:ac8:578e:0:b0:4ee:1bdb:a547 with SMTP id d75a77b69052e-5074436f3fbmr74538301cf.14.1772202194248; Fri, 27 Feb 2026 06:23:14 -0800 (PST) Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 References: In-Reply-To: Date: Fri, 27 Feb 2026 15:23:02 +0100 X-Gm-Features: AaiRm51P4MI2C9hnUMdZ8FFBkKVDbjusCwzdhCvJFvPc6iu_gJWeaVGKtc1sf6g Message-ID: Subject: Re: [PHP-DEV] [Vote] Closure optimizations To: PHP internals Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable From: tovilo.ilija@gmail.com (Ilija Tovilo) Hi Kamil On Fri, Feb 27, 2026 at 3:16=E2=80=AFPM Kamil Tekiela wrote: > > On Fri, 27 Feb 2026 at 13:47, Ilija Tovilo wrote= : > > > > As foreshadowed, I opened the vote for the closure optimizations RFC. > > > > RFC: https://wiki.php.net/rfc/closure-optimizations > > Is there any benefit for projects that already mark all static > closures with the keyword "static"? Yes. The caching of stateless closures is what brings most of the performance benefits. Static closure inference enables this optimization in more cases, namely in codebases that don't explicitly want to add static for whatever reason. > One thing I am worried about is that people may think the RFC removes > the need for that keyword, which it looks like it doesn't. Not only > can your patch not infer 100% of static closures, but it also doesn't > prevent accidentally using $this in a closure that was supposed to be > static. The RFC is explicit about static not being redundant. > While explicit marking remains preferable, this optimization aims to bene= fit codebases that prefer not to add static to avoid visual clutter, as wel= l as those who aren't aware of these subtle performance implications. Ilija