1--TEST--
2Check that arguments are freed when calling a deprecated function
3--EXTENSIONS--
4zend_test
5--FILE--
6<?php
7
8set_error_handler(function($code, $msg) {
9    throw new Error($msg);
10});
11
12try {
13    zend_test_deprecated(new stdClass);
14} catch (Error $e) {
15    echo $e->getMessage(), "\n";
16}
17
18$ret = new stdClass;
19try {
20    $ret = zend_test_deprecated(new stdClass());
21} catch (Error $e) {
22    echo $e->getMessage(), "\n";
23}
24
25try {
26    $fn = 'zend_test_deprecated';
27    $fn(new stdClass);
28} catch (Error $e) {
29    echo $e->getMessage(), "\n";
30}
31
32$ret = new stdClass;
33try {
34    $fn = 'zend_test_deprecated';
35    $ret = $fn(new stdClass);
36} catch (Error $e) {
37    echo $e->getMessage(), "\n";
38}
39
40?>
41--EXPECT--
42Function zend_test_deprecated() is deprecated
43Function zend_test_deprecated() is deprecated
44Function zend_test_deprecated() is deprecated
45Function zend_test_deprecated() is deprecated
46