Skip to content

continue / break out of a try skips its finally #40

Closed

Description

@blacktrs

Summary

continue / break out of a try skips its finally.

Fix planned in the ownership redesign epic (PR #15, task 9: exception unwinding / finally). Tracking only.

Repro

<?php
$x = 0;
for ($i = 0; $i < 2; $i++) { try { continue; } finally { $x++; } }
echo $x, "\n";
foreach ([1] as $_) { try { break; } finally { $x += 10; } }
echo $x, "\n";

Expected (php 8.5)

2
12

Actual (manticore 10affa68, macOS arm64)

0
0

Tracking

Known-bug repro: tests/aot/repro/wrong/finally_skipped_on_continue.php — bash tests/aot/xfail.sh -k finally_skipped_on_continue reports XFAIL while this is open and XPASS once it is fixed; then move the repro into tests/aot/cases/ and close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugwrong-answer

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions