Bug #72215 [Opn]: Wrong return value if var modified in finally
Edit report at https://bugs.php.net/bug.php?id=72215&edit=1
ID: 72215
Updated by: laruence@php.net
Reported by: nikic@php.net
Summary: Wrong return value if var modified in finally
Status: Open
Type: Bug
Package: Scripting Engine problem
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
I think the current way also makes sense, not a big issue here, it depends how we explain it..
Previous Comments:
------------------------------------------------------------------------
[2016-05-13 23:26:25] nikic@php.net
Description:
------------
Should return 1, the unmodified value, but returns 2.
Test script:
---------------
<?php
function test() {
$a = 1;
try {
return $a;
} finally {
$a = 2;
}
}
var_dump(test());
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=72215&edit=1
Thread (4 messages)