1
0
mirror of https://github.com/php/php-src.git synced 2026-04-13 02:52:48 +02:00
Files
archived-php-src/Zend/tests/call_to_deprecated_function_args.phpt
Nikita Popov dbe5725ff3 Rename zend-test to zend_test
The extension name should match the name of the ext/ directory,
otherwise it will not get picked up by run-tests. It would be possible
to remap this in run-tests, but I think it's better to rename the
extension to follow the standard format. Other extensions also
use underscore instead of hyphen (e.g. pdo_mysql and not pdo-mysql).
Of course, the ./configure option remains hyphenated.

Closes GH-6613.
2021-01-19 15:28:15 +01:00

47 lines
964 B
PHP

--TEST--
Check that arguments are freed when calling a deprecated function
--SKIPIF--
<?php
if (!extension_loaded('zend_test')) die('skip zend_test extension not loaded');
--FILE--
<?php
set_error_handler(function($code, $msg) {
throw new Error($msg);
});
try {
zend_test_deprecated(new stdClass);
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
$ret = new stdClass;
try {
$ret = zend_test_deprecated(new stdClass());
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
try {
$fn = 'zend_test_deprecated';
$fn(new stdClass);
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
$ret = new stdClass;
try {
$fn = 'zend_test_deprecated';
$ret = $fn(new stdClass);
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECT--
Function zend_test_deprecated() is deprecated
Function zend_test_deprecated() is deprecated
Function zend_test_deprecated() is deprecated
Function zend_test_deprecated() is deprecated