TypePHP 编译器 https://swoole.com/aot/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

29 lines
631 B

--TEST--
Bug #70713: Use After Free Vulnerability in array_walk()/array_walk_recursive()
--SKIPIF--
<?php die("skip AOT array_walk_recursive UAF differs from PHP"); ?>
--FILE--
<?php
class obj
{
function __tostring(): string {
global $arr;
$arr = 1;
for ($i = 0; $i < 5; $i++) {
$v[$i] = 'hi' . $i;
}
return 'hi';
}
}
function main()
{
$arr = array('string' => new obj());
try {
array_walk_recursive($arr, 'settype');
} catch (\TypeError $e) {
echo $e->getMessage() . "\n";
}
}
?>
--EXPECT--
Iterated value is no longer an array or object