Bug #72188 [Opn->Ver]: Nested try/finally blocks losing return value

From: Date: Wed, 11 May 2016 07:20:36 +0000
Subject: Bug #72188 [Opn->Ver]: Nested try/finally blocks losing return value
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-201003@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=72188&edit=1 ID: 72188 Updated by: laruence@php.net Reported by: lee at saferite dot com Summary: Nested try/finally blocks losing return value -Status: Open +Status: Verified Type: Bug Package: Unknown/Other Function Operating System: Ubuntu 14.04 PHP Version: 7.0.6 -Assigned To: +Assigned To: laruence Block user comment: N Private report: N New Comment: they should use different fast_call_var.... Previous Comments: ------------------------------------------------------------------------ [2016-05-10 19:11:04] lee at saferite dot com Description: ------------ When you next a try/finally inside of a finally block it causes the return value from the outer try block to be lost. Test script: --------------- <?php function test() { try { return 5; } finally { try { // NOOP } finally { // NOOP } } } $a = test(); if($a !== 5) { echo "FAILED: expected 5, received ", var_export($a), PHP_EOL; } else { echo "Passed", PHP_EOL; } Expected result: ---------------- The call to test() should be seeing an int value of 5. Actual result: -------------- 5.5.16-5.6.21 -- Works as expected 5.5.0-5.5.15 -- Exit code of 137 (SIGKILL) 7.0.0-7.0.6 -- The outer return value is lost and a null is returned. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=72188&edit=1

« previous php.bugs (#201003) next »