Bug #76007 [NEW]: Different garbage collection behavior on PHP7.1 and 7.2

From: Date: Sun, 25 Feb 2018 22:22:24 +0000
Subject: Bug #76007 [NEW]: Different garbage collection behavior on PHP7.1 and 7.2
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-214102@lists.php.net to get a copy of this message
From: maestroprog at gmail dot com Operating system: Ubuntu Artful PHP version: 7.2.2 Package: Scripting Engine problem Bug Type: Bug Bug description:Different garbage collection behavior on PHP7.1 and 7.2 Description: ------------ This (test script) code on PHP 7.1 throws the exception. But on PHP 7.2 there is no such. But if write at the end of the script: unset($generator); then PHP 7.2 throws the exception. Sample: https://3v4l.org/JQEOj Test script: --------------- <?php function shutdown(): \Generator { try { yield; } finally { echo 'UNSET BEFORE yield', PHP_EOL; yield; } } $generator = shutdown(); $generator->rewind(); Expected result: ---------------- UNSET BEFORE yield Fatal error: Uncaught Error: Cannot yield from finally in a force-closed generator... Actual result: -------------- UNSET BEFORE yield -- Edit bug report at https://bugs.php.net/bug.php?id=76007&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=76007&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=76007&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=76007&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=76007&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=76007&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=76007&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=76007&r=needscript Try newer version: https://bugs.php.net/fix.php?id=76007&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=76007&r=support Expected behavior: https://bugs.php.net/fix.php?id=76007&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=76007&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=76007&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=76007&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=76007&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=76007&r=dst IIS Stability: https://bugs.php.net/fix.php?id=76007&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=76007&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=76007&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=76007&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=76007&r=mysqlcfg

« previous php.bugs (#214102) next »