<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/pre-rfc-deprecate-returning-from-a-finally-block-pprl4vo77" -->

---
title: [PRE-RFC] Deprecate returning from a finally block
description: A PHP internals pre-RFC discussion proposes deprecating `return` inside `finally` blocks. Currently, a `return` in a `finally` block silently discards any...
canonical: https://daily.dev/posts/pre-rfc-deprecate-returning-from-a-finally-block-pprl4vo77
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: [PRE-RFC] Deprecate returning from a finally block | daily.dev
og:description: A PHP internals pre-RFC discussion proposes deprecating `return` inside `finally` blocks. Currently, a `return` in a `finally` block silently discards any...
og:url: https://daily.dev/posts/pre-rfc-deprecate-returning-from-a-finally-block-pprl4vo77
og:image: https://api.daily.dev/og/posts/PprL4vo77.png
og:image:alt: [PRE-RFC] Deprecate returning from a finally block
og:image:width: 1200
og:image:height: 630
og:locale: 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)** · 10 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 author implemented the deprecation and scanned the top ~5000 Composer packages, finding only 12 occurrences across 9 packages — 3 of which appear to be genuine latent bugs. The proposal is to deprecate the behavior in PHP 8.6 with an eye toward making it a hard error in a future major version. Multiple PHP internals contributors, including Larry Garfield and Gina P. Banyard, expressed support, noting that C# already prohibits `return` in `finally` blocks at compile time.

## Full article

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

## 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-nnmk421vv) · 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
- [\[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-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-mw01tahgg) · 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-pprl4vo77)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"[PRE-RFC] Deprecate returning from a finally block","url":"https://daily.dev/posts/pre-rfc-deprecate-returning-from-a-finally-block-pprl4vo77","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/pre-rfc-deprecate-returning-from-a-finally-block-pprl4vo77"},"datePublished":"2026-06-19T23:57:29.384Z","dateModified":"2026-06-19T23:58:21.377Z","description":"A PHP internals pre-RFC discussion proposes deprecating `return` inside `finally` blocks. Currently, a `return` in a `finally` block silently discards any...","image":"https://media.daily.dev/image/upload/s--ZrL_HSsR--/f_auto/v1722860399/public/Placeholder%2006","thumbnailUrl":"https://media.daily.dev/image/upload/s--ZrL_HSsR--/f_auto/v1722860399/public/Placeholder%2006","isAccessibleForFree":true,"articleSection":"externals.io","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"externals.io","logo":"https://media.daily.dev/image/upload/s--9i0zxASK--/f_auto,q_auto/v1780213616/logos/externals?_a=BAMAMiWQ0","url":"https://daily.dev/sources/externals"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/pre-rfc-deprecate-returning-from-a-finally-block-pprl4vo77","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"php,language-design","timeRequired":"PT10M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"externals.io","item":"https://daily.dev/sources/externals"},{"@type":"ListItem","position":3,"name":"[PRE-RFC] Deprecate returning from a finally block"}]}
```

