1--TEST-- 2Dtor may throw exception during FE_FETCH assignment 3--FILE-- 4<?php 5 6$v = new class { 7 function __destruct() { 8 throw new Exception("foo"); 9 } 10}; 11 12try { 13 foreach ([1, 2] as $v) { 14 var_dump($v); 15 } 16} catch (Exception $e) { 17 echo $e->getMessage(), "\n"; 18} 19 20?> 21--EXPECT-- 22foo 23