xref: /PHP-8.4/ext/standard/tests/array/bug77793.phpt (revision e97577ed)
1--TEST--
2Bug #77793: Segmentation fault in extract() when overwriting reference with itself
3--FILE--
4<?php
5
6$str = 'foo';
7$vars = ['var' => $str . 'bar'];
8$var = &$vars['var'];
9extract($vars);
10var_dump($vars, $var);
11
12?>
13--EXPECT--
14array(1) {
15  ["var"]=>
16  &string(6) "foobar"
17}
18string(6) "foobar"
19