Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129692 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 3DB681A00BC for ; Fri, 26 Dec 2025 15:41:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1766763684; bh=dfl81nvQF2Ow0Wp7hLxt2dZY++Dty0WOOS8KKHQn+5A=; h=From:Date:Subject:To:From; b=HgS7LzbJcsYjVP/MyU8ci0CdkGPAdW8SahhCRbkdLx6+2meblUCk86OABcWEEkGqL h/76fL/tgfbmQndQ75PL43e7C+TOx3T9yigKFNWiNwUjRDeSSnLEM95cUNB0/GnDz5 tD6lwytepnAq3poSiUCE7EyM7PeeUP2mkWd1OQ5bxCyA9hDjs77F3vjYwb0HLgeGu1 cgwngwsQ2NSqS99mF2gyhBLHLil35luzJb+yGcfmuw+8wwQBtlwJmTQrje/5oPrfMI P2xZn4gb8T7vk0YZSxP3JytIJtQ1lupZxI60Te16Qzzf4QgrvT3yp+8fjcQtqBZwiO 95u9PX9WPk0zA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 23EEF18004C for ; Fri, 26 Dec 2025 15:41:24 +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_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, 26 Dec 2025 15:41:20 +0000 (UTC) Received: by mail-qt1-f180.google.com with SMTP id d75a77b69052e-4eddfb8c7f5so67830521cf.1 for ; Fri, 26 Dec 2025 07:41:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1766763675; x=1767368475; darn=lists.php.net; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=dfl81nvQF2Ow0Wp7hLxt2dZY++Dty0WOOS8KKHQn+5A=; b=ItaFu561d5wdNSE7ypfNENmeXYobZepxGZtf0mXMUSaR3cp/qZX4tJfOtwKI4Z6/wm wIQ/W+aM0jIEA5pwuLv4fTRFokWG+L5Nwf6Pr9UlFO8ftU+U3hPaBhCDxm/BPEfnlxGn JEW2UQRdh9XUglCWxUUi9GJOjgpvWfXvecCD2IG75F3oYQYFhZolNY1TrTzDlbjnYi1L N+pN2UyeAX5YciiTpHi90suFtnAoIJPtwNDX11Du1VH7Tk/a3nxODSt4t83t1FUcbBsd 0TnWOvnWrZK6aGHb2VFrIzW9j7JdP0aBn3t1as+ztweOpKB7mDHzfluQtTCEKFQF8/LX w0vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766763675; x=1767368475; h=to:subject:message-id:date:from:mime-version:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=dfl81nvQF2Ow0Wp7hLxt2dZY++Dty0WOOS8KKHQn+5A=; b=rbc+rDfNlK+kDrneTaY0xnrsVfZlvJWnOonpKbcOogE72ZvFk6hWUYAiXC3ISmku+H //eBb8tAKSkTbRIAEE34IyIrONvQ5zHajqdtZy4sSMSPz/9gFoH9W5rFkZAxHY9UN05q jB+kBhBOtdpNsa6pyaZqqdNYKJJtJ8VwPlxF3UBaOI3VQLRXDHR9z84QMzakEDuNFb+6 Z/Vsol7AaU11GU3nXJHP/NZLO9S+lfaWcVbpdFGGAldIAPwL9KbG5QMs78I4/BoRltMM pIfk4zrJJJg5es4IApwXHt19Syqcl1I08WTMUjuHN4uc/GHFS4fhdbfIfli9yAmm1khO EiIg== X-Gm-Message-State: AOJu0YwMdha4ZLiKJnKiKcHEpqHmZo4HvvlWlXp49mJ83VhprNlr5I8f V6lesay1PGrt9ZJu/Zp4lmDLDF5WxYIUYnE8z1bv3+c4APYYUuxums4aqaubFM/Y+qcTbK7aVom ZMpzjD0IX4X8fbQGvSJisY5RG/h1I3CC6aAYCdhQsFiM0 X-Gm-Gg: AY/fxX6c8Zcs9GP3KNbzZMyaHKxfCV42QIJsQULJrqcJ5zJBYFQmUqHWMixX/XiM5zH 9MQCUQRHJkyGJSK+r+6eAJovGTB5Cy+Kre8JS7vnuzZ1hh7tZFgEPfTZww+92oMkrYO+Rnr9JAb fyKbIC32gKgvJ4AJz2gq0AShdZOwMrhfYEw2m4K6Wubz9RwuLRvxk0gzpgbgtTAnO5KedJoQKX8 GsgfK63LedEvsFOOWkOU6MNIV1CCi4qwhlxL9eb5gvjuHUcNyEnO8YLsK/9JYAtGqxSgqk= X-Google-Smtp-Source: AGHT+IF7ug836al0tgf7fDar/r9u6YyqkOo7i7c3u0x00rVRH4BqtWtjENukHtnf6olHrcn/mgUkZ5lb/+AX9bUJ9ho= X-Received: by 2002:ac8:5d02:0:b0:4eb:a3fe:53d with SMTP id d75a77b69052e-4f4abdebbabmr391512811cf.79.1766763674929; Fri, 26 Dec 2025 07:41:14 -0800 (PST) Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 Date: Fri, 26 Dec 2025 19:41:04 +0400 X-Gm-Features: AQt7F2r6wmhzkBbCajW4MF7DqyhXSqhlBrMl12LHeb6aQb8-VBDwoOt9Gnm2wQc Message-ID: Subject: [PHP-DEV] RFC Karma request: native defer keyword (Zig-style) To: PHP internals Content-Type: multipart/alternative; boundary="0000000000003f100a0646dcb92c" From: khaledalam.net@gmail.com (Khaled Alam) --0000000000003f100a0646dcb92c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, I'm Khaled Alam, a software engineer based in the UAE and a long-time PHP user. I'd like to request RFC karma to publish an RFC proposing a nativ= e "*defer"* feature and gather community feedback. Inspired by Zig's "defer", it schedules a block to run when the current function exits (return, exception, or natural end), executed in LIFO order, aimed at safer cleanup without repetitive try/finally scaffolding. Proof-of-concept implementation PR . Current status: [x] Parser/AST support for defer { ... } [x] Compilation + VM support with per-call defer stack (not shared on op_array) [x] Defers run correctly on explicit/implicit returns, LIFO order [_] I=E2=80=99m currently working on exception-unwinding handling so defers= also run when an exception is thrown Wiki username: *khaledalamxyz*GitHub username*: *khaledalam Thank you for considering granting RFC karma. Best regards, Khaled Alam --0000000000003f100a0646dcb92c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Hi, I'm Khaled Alam, a software engineer base= d in the UAE and a long-time PHP user. I'd like to request RFC karma to= publish an RFC proposing a native=C2=A0&qu= ot;defer" feature and gather community feedback.

Inspired by Zig's "defer", it sched= ules a block to run when the current functi= on exits (return, exception, or natural end), executed in LIFO order, aimed= at safer cleanup without repetitive try/finally scaffolding.

Proof-of-concept implementation=C2=A0PR.

Current status:
<= /font>[x] Parser/AST support <= /span>for=C2=A0defer { ... }
[x] Compilation=C2=A0+ VM support with per-c= all defer stack (not shared on op_array)
[x] Defers run correctly on explicit/implicit returns,= LIFO order
[_] I=E2= =80=99m currently working on exception-unwinding handling so defers also=C2=A0run when an exception is thrown

Wiki username:=C2=A0= khaledalamxyz
GitHub=C2=A0username:=C2=A0khaledalam

Thank you for<= /span> considering granting RFC karma.

Best regards,
Khaled Alam

=
--0000000000003f100a0646dcb92c--