1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Files
archived-php-src/ext/standard/tests/gh18209.phpt
Ilija Tovilo a21065e6eb Use-after-free in extract() with EXTR_REFS
Fixes GH-18209
Closes GH-18211
2025-04-01 16:33:30 +02:00

24 lines
336 B
PHP

--TEST--
GH-18209: Use-after-free in extract() with EXTR_REFS
--CREDITS--
Noam Rathaus (nrathaus)
--FILE--
<?php
class C {
public function __destruct() {
var_dump($GLOBALS['b']);
$GLOBALS['b'] = 43;
}
}
$b = new C;
$array = ['b' => 42];
extract($array, EXTR_REFS);
var_dump($b);
?>
--EXPECT--
int(42)
int(43)