php-src/Zend/tests/call_with_refs.phpt
Nikita Popov a31f46421d Allow exceptions in __toString()
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.
2019-06-05 14:25:07 +02:00

19 lines
339 B
PHP

--TEST--
Check call to non-ref function with call-time refs
--FILE--
<?php
class Test {
public function __toString() {
global $my_var;
$my_var=0x12345;
return "";
}
}
$my_var = str_repeat("A",64);
$data = call_user_func_array("substr_replace",array(&$my_var, new Test(), 1));
echo "OK!";
?>
--EXPECT--
OK!