1
0
mirror of https://github.com/php/php-src.git synced 2026-04-19 05:51:02 +02:00
Files
archived-php-src/Zend/tests/unexpected_ref_bug.phpt
2019-12-12 13:49:05 +01:00

20 lines
459 B
PHP

--TEST--
Crash when function parameter modified via unexpected reference
--FILE--
<?php
class Test {
public function __toString() {
global $my_var;
$my_var = 0;
return ",";
}
}
$my_var = str_repeat("A", 64);
$data = call_user_func_array("explode", array(new Test(), &$my_var));
$my_var = str_repeat("A", 64);
$data = call_user_func_array("str_replace", array(&$my_var, new Test(), "foo"));
echo "Done.\n";
?>
--EXPECTF--
Done.