Bug #72347 [Opn->Csd]: VERIFY_RETURN type casts visible in finally

From: Date: Wed, 13 Jul 2016 12:09:03 +0000
Subject: Bug #72347 [Opn->Csd]: VERIFY_RETURN type casts visible in finally
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-202275@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=72347&edit=1 ID: 72347 Updated by: dmitry@php.net Reported by: nikic@php.net Summary: VERIFY_RETURN type casts visible in finally -Status: Open +Status: Closed Type: Bug Package: Scripting Engine problem PHP Version: master-Git-2016-06-06 (Git) Block user comment: N Private report: N New Comment: Automatic comment on behalf of dmitry@zend.com Revision: http://git.php.net/?p=php-src.git;a=commit;h=3b8cb2119b33ed6b7701d78d32eed63593cf61ff Log: Fixed bug #72347 (VERIFY_RETURN type casts visible in finally) Fixed bug #72216 (Return by reference with finally is not memory safe) Fixed bug #72215 (Wrong return value if var modified in finally) Previous Comments: ------------------------------------------------------------------------ [2016-06-06 21:57:00] nikic@php.net I'm leaving this alone for now, as the case of by-reference return is somewhat tricky -- I'm not even sure how it should behave. Piling this into the general category of "finally return value bugs" we have open. ------------------------------------------------------------------------ [2016-06-06 16:52:44] nikic@php.net Description: ------------ If VERIFY_RETURN leads to a type-cast on a CV return, the finally block will see the cast value rather than the original value. Test script: --------------- <?php function test() : int { $d = 1.5; try { return $d; } finally { var_dump($d); } } test(); Expected result: ---------------- float(1.5) Actual result: -------------- int(1) ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=72347&edit=1

« previous php.bugs (#202275) next »