Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:128405 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 660981A00BC for ; Wed, 6 Aug 2025 11:34:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1754479987; bh=Yj2RHzloi3Rqxsspk0bAqcbmMAyomF052UkFHsrw8oU=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=HwqNZuPD+Z/tzH7qzRCmolb/VHCoFZB96JUrjZGr3NCKPCAqf6hNwo3kyOW9U3D4Y rt26c4hQJOMNXcAgYtE4u0pa87yTMCfIC94fVN5bH8Cwr+3VncLZsZgUV93GxwmRp0 hRzQFrebKl0zb0uYzE9y4mY8JlWyXEJWneTOFdZ0FAjHk7KfK4vAayG0GNRvN/LAOS 7A6i1ZasgwPlHDGxsGdusaYpZsTIWE9o3u5qaOTJCLdVoFuEua62hfsDREpTjfeL6g G4wQQXpVG7ZNzLshRkWAqnhgCIeNvGA/HLIxjOGtCyaFOcz0ncDlERGBZGiRbzP5gf 1CaQkdDE9ebAA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id C602A180061 for ; Wed, 6 Aug 2025 11:33:06 +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.4 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, SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: <91liahim@gmail.com> Received: from mail-yw1-f174.google.com (mail-yw1-f174.google.com [209.85.128.174]) (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, 6 Aug 2025 11:33:06 +0000 (UTC) Received: by mail-yw1-f174.google.com with SMTP id 00721157ae682-71b5279714cso50482777b3.0 for ; Wed, 06 Aug 2025 04:34:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754480085; x=1755084885; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=L9t/fou4z8S2jwoJUe8+17YfP0pGzUkFokswN/jzSsk=; b=hDrOOEkvUkFyn+m96Ir7YKaziybdMF9RJp+gvJFfzFTXMD6ovYjU/iroZrEVJD+QLI zE3OQEUt05qibLe8lJVI2rEUb7O9aQ1Y7oTXFLJfseEjGtRjYbag571dvVc0qfTYxxIN LLxVQHEFDOtbb4p0YivYG9/WM6vQfRvOH/XrAlbx1h7vJ3vp2JhKKoqJzuUhwt7nLKTc UuDgBmQfV3hKPuFgeDxz/s/3tG0/qjx/D3uwFz4pS4ga9k3pP1l2FFnFWnRi+UsQT7nO n8032BwxgQwcJcwlDBjwwXW7eklNa0HMsws5wtuwcgTn0YdU2poHvZ9EYdiW/J7RRqob WNkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754480085; x=1755084885; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=L9t/fou4z8S2jwoJUe8+17YfP0pGzUkFokswN/jzSsk=; b=BFC5/+iMyRPE3ic6D3ojrziO3LlDZKfgMKqvC/JJQOuaVCGc596C4NwSIN7jRLkT8r CpCnA6v9uEuPisE+ilGNQxypht4ClSTwojyOfLcCraabgS8wDCgfFSoJem9yDgVveQgS XBs5CJ0Vw3eSLzb7sk0jpCSEh/FnYg1gzxZ4BZQS//wWjLvMYgP354NZrDXrXJBNhOtY eTbXdItZ4gFi6gNwM8rOJB7rWY7ZiZhIZI8x/X2PW8oTgP7uK2lpqj06diuoxyYv+V/w Y04hxGGroOxt4aXLwp4IwiQcJQZiES2rcVKyb6ifANl/lS2CXWS0Llng+bZNSbmRIufp OfdQ== X-Gm-Message-State: AOJu0Yxm0qSB+tieE+Y8yKnolVrpMGcUcaQfbrRAe+oC7nFgSSstSTwF bKQhbViIMQ8+9+mXTbTjsrxANSpnPI6iEUeI0zXZG5lX6lFb+OCcux6JXrx7FaVV9buht1dCqpI phZSKIKjVO8oBIYF3TenVQjNfI1hgkp8= X-Gm-Gg: ASbGncss7Zk+6LOBWF+3+r00PRyP/gW7Rj9WBlAxz98f7pHiUky+G0ets2O0UN6gLof paz3Eg37EGJa2tXW9cPqPbRebqtrMaZztwKOya2X6qeNQgZbVlibl6+P89GGOZ+xHy+IJHTRlEz YOwcX6X1bk/akDP4sTLFgJGT5svXH3GNTyq3+d2YAHCuf7e6kAYAq7CU+YupoRWobYkf7ATRyyl M/7sMk= X-Google-Smtp-Source: AGHT+IFrcsAHb1r9B9IG1L1B+2Hfow9KCiMZYOtEGVMgl1DmeK9xi4EweSPRcpPbHl4oBDZuLiObQU0BgmkE7ovg+ss= X-Received: by 2002:a05:690c:f03:b0:71a:3484:abe8 with SMTP id 00721157ae682-71bc98866fbmr33815677b3.34.1754480085255; Wed, 06 Aug 2025 04:34:45 -0700 (PDT) Precedence: list list-help: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 References: <94a57a5c-41bc-442d-a5e3-13eaea29053b@app.fastmail.com> In-Reply-To: <94a57a5c-41bc-442d-a5e3-13eaea29053b@app.fastmail.com> Date: Wed, 6 Aug 2025 16:34:34 +0500 X-Gm-Features: Ac12FXznnuivT2BXQJQDjpbRCZnjG1uxMaXMtb8OF1S_iF4AdigK-VmvQi1a_rQ Message-ID: Subject: Re: [PHP-DEV] [RFC] Optional Catch Block Body To: Casper Langemeijer Cc: internals@lists.php.net Content-Type: multipart/alternative; boundary="0000000000003f49c0063bb0ba62" From: 91liahim@gmail.com (Mihail Liahimov) --0000000000003f49c0063bb0ba62 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi! At the moment, I can suggest this syntax: try { // do something } catch (SomeIgnorableException) finally { // do something } I also generally like the above idea with the keyword ignore. =D1=87=D1=82, 31 =D0=B8=D1=8E=D0=BB. 2025=E2=80=AF=D0=B3. =D0=B2 20:24, Cas= per Langemeijer : > > > On Thu, Jul 31, 2025, at 06:53, Mihail Liahimov wrote: > > Proposal > > Allow the following syntax where the curly braces can be omitted when no > exception variable is specified and no handling is needed: > > try { > // code that may throw > } catch (SomeError); > > > Can you write out how this would interoperate with the finally keyword? > --0000000000003f49c0063bb0ba62 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi!

At the moment, I can suggest this syntax:
try {
// do something
} catch (SomeIgnorableException) finally {// do something
}

I also generally like the above idea with the = keyword ignore.



=D1=87=D1=82, 31 =D0=B8=D1= =8E=D0=BB. 2025=E2=80=AF=D0=B3. =D0=B2 20:24, Casper Langemeijer <langemeijer@php.net>:


On Thu, Jul 31, 2025, at 06:53, Mihail Liahimov wrote:
Proposal

Allow the following syntax where = the curly braces can be omitted when no exception variable is specified and= no handling is needed:

try {
=C2=A0 =C2= =A0 // code that may throw
} catch (SomeError);

Can you write out how this would interoperate wi= th the finally keyword?
--0000000000003f49c0063bb0ba62--