1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Files
archived-php-src/Zend/tests/gh20183_002.phpt
Ilija Tovilo 12920370e1 Fix stale EG(opline_before_exception) pointer through eval
Fixes GH-20183
Closes GH-20184
2025-10-27 16:48:46 +01:00

35 lines
582 B
PHP

--TEST--
GH-20183: Stale EG(opline_before_exception) pointer through eval
--CREDITS--
Arnaud Le Blanc <lbarnaud@php.net>
--FILE--
<?php
function gen() {
try {
yield 1;
} finally {
eval('try { throw new Error(); } catch (Error) {}');
debug_print_backtrace();
}
}
class A {
private $gen;
function __construct() {
$this->gen = gen();
$this->gen->rewind();
}
}
B::$a = new A();
?>
--EXPECTF--
#0 %s(20): gen()
Fatal error: Uncaught Error: Class "B" not found in %s:20
Stack trace:
#0 {main}
thrown in %s on line 20