xref: /PHP-7.1/ext/intl/tests/badargs.phpt (revision 7af945e2)
1--TEST--
2Check that bad arguments return the same
3--SKIPIF--
4<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
5--FILE--
6<?php
7$funcs = get_extension_funcs("intl");
8function ignore_err() {}
9set_error_handler("ignore_err");
10$arg = new stdClass();
11foreach($funcs as $func) {
12        $rfunc = new ReflectionFunction($func);
13        if($rfunc->getNumberOfRequiredParameters() == 0) {
14                continue;
15        }
16
17		try {
18			$res = $func($arg);
19		} catch (Exception $e) {
20			continue;
21		} catch (Error $e) {
22			continue;
23		}
24        if($res != false) {
25                echo "$func: ";
26                var_dump($res);
27        }
28}
29echo "OK!\n";
30?>
31--EXPECT--
32OK!
33