mirror of
https://github.com/php/php-src.git
synced 2025-08-18 15:08:55 +02:00

RFC: https://wiki.php.net/rfc/tostring_exceptions And convert some object to string conversion related recoverable fatal errors into Error exceptions. Improve exception safety of internal code performing string conversions.
19 lines
435 B
PHP
19 lines
435 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=array(1,2,3);
|
|
$data = call_user_func_array("implode",array(&$my_var, new Test()));
|
|
echo "Done.\n";
|
|
?>
|
|
--EXPECT--
|
|
Done.
|