php-src/Zend/tests/call_to_deprecated_function_args.phpt
Nikita Popov b6f76aca54 Improve exception handling for abstract/deprecated calls
Reuse existing arg freeing loop instead of duplicating it.

Additionally also handle deprecated in DO_FCALL_BY_NAME.
2019-09-04 15:19:21 +02:00

44 lines
785 B
PHP

--TEST--
Check that arguments are freed when calling a deprecated function
--FILE--
<?php
set_error_handler(function($code, $msg) {
throw new Error($msg);
});
try {
ezmlm_hash(new stdClass);
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
$ret = new stdClass;
try {
$ret = ezmlm_hash(new stdClass);
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
try {
$fn = 'ezmlm_hash';
$fn(new stdClass);
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
$ret = new stdClass;
try {
$fn = 'ezmlm_hash';
$ret = $fn(new stdClass);
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECT--
Function ezmlm_hash() is deprecated
Function ezmlm_hash() is deprecated
Function ezmlm_hash() is deprecated
Function ezmlm_hash() is deprecated