---
title: "[PRE-RFC] Deprecate returning from a finally block"
url: https://daily.dev/posts/pre-rfc-deprecate-returning-from-a-finally-block-mw01tahgg
source_url: https://externals.io/message/131415
type: article
source: "externals.io"
published: 2026-06-20T08:27:20.970Z
updated: 2026-06-20T08:27:43.870Z
tags: ["php", "language-design"]
reading_time: 12
upvotes: 0
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# [PRE-RFC] Deprecate returning from a finally block

**[externals.io](https://daily.dev/sources/externals)** · 12 min read · 0 upvotes · 0 comments

## Summary

A PHP internals pre-RFC discussion proposes deprecating `return` inside `finally` blocks. Currently, a `return` in a `finally` block silently discards any pending exception or return value from the `try`/`catch` block, with no error or notice. This is inconsistent with PHP's handling of `break`, `continue`, and `goto` inside `finally`, which are already compile errors. The original RFC author admitted adding it only because Java allowed it, even though he thought it made no sense — and Java itself warns about it. The author implemented the deprecation and scanned the top ~5000 Composer packages, finding only 12 occurrences across 9 packages, with 3 appearing to be genuine latent bugs. The proposal is to deprecate in PHP 8.6 and eventually make it an error in a future major version. Responses from PHP internals contributors (Gina P. Banyard, Larry Garfield) are supportive, with Larry suggesting it could be folded into the omnibus deprecations RFC rather than needing its own RFC.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://externals.io/message/131415>

## Similar posts on daily.dev

- [\[PRE-RFC\] Deprecate returning from a finally block](https://daily.dev/posts/pre-rfc-deprecate-returning-from-a-finally-block-kmtxhue6u) · externals.io · 0 upvotes · 0 comments
- [\[PRE-RFC\] Deprecate returning from a finally block](https://daily.dev/posts/pre-rfc-deprecate-returning-from-a-finally-block-yg66umszv) · externals.io · 0 upvotes · 0 comments
- [\[PRE-RFC\] Deprecate returning from a finally block](https://daily.dev/posts/pre-rfc-deprecate-returning-from-a-finally-block-exty46hbf) · externals.io · 0 upvotes · 0 comments

---

Tags: [#php](https://daily.dev/tags/php), [#language-design](https://daily.dev/tags/language-design)

[View this post on daily.dev](https://daily.dev/posts/pre-rfc-deprecate-returning-from-a-finally-block-mw01tahgg)
