---
title: "[PRE-RFC] Deprecate returning from a finally block"
url: https://daily.dev/posts/pre-rfc-deprecate-returning-from-a-finally-block-oiovloynx
source_url: https://externals.io/message/131408
type: article
source: "externals.io"
published: 2026-06-19T15:27:17.021Z
updated: 2026-06-19T16:20:03.204Z
tags: ["php", "language-design"]
reading_time: 8
upvotes: 1
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)** · 8 min read · 1 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 warning. The author notes this is inconsistent — `break`, `continue`, and `goto` out of `finally` are already compile errors, and `throw` auto-chains discarded exceptions. The feature was originally added only because Java allowed it, despite the original RFC author thinking it made 'no sense'. After implementing the deprecation and scanning ~5000 Composer packages, only 12 occurrences were found across 9 packages, with 3 identified as genuine latent bugs. The proposal is to deprecate now and make it a compile error in a future major version, consistent with how C# handles the same case.

## Full article

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

## 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-evdyy95ba) · externals.io · 1 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
- [\[PRE-RFC\] Deprecate returning from a finally block](https://daily.dev/posts/pre-rfc-deprecate-returning-from-a-finally-block-v7kxxklnx) · 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-kmtxhue6u) · 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-oiovloynx)
