mirror of
https://github.com/php/php-src.git
synced 2024-09-21 18:07:23 +00:00
a8e92e361f
Closes GH-6370
86 lines
1.7 KiB
PHP
86 lines
1.7 KiB
PHP
--TEST--
|
|
Test that there is no arginfo/zpp mismatch in strict mode
|
|
--SKIPIF--
|
|
<?php
|
|
if (getenv('SKIP_MSAN')) die("skip msan misses interceptors for some functions");
|
|
?>
|
|
--FILE--
|
|
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
require __DIR__ . "/arginfo_zpp_mismatch.inc";
|
|
|
|
function test($function) {
|
|
if (skipFunction($function)) {
|
|
return;
|
|
}
|
|
|
|
ob_start();
|
|
if (is_string($function)) {
|
|
echo "Testing $function\n";
|
|
} else {
|
|
echo "Testing " . get_class($function[0]) . "::$function[1]\n";
|
|
}
|
|
try {
|
|
@$function();
|
|
} catch (Throwable) {
|
|
}
|
|
try {
|
|
@$function(null);
|
|
} catch (Throwable) {
|
|
}
|
|
try {
|
|
@$function(null, null);
|
|
} catch (Throwable) {
|
|
}
|
|
try {
|
|
@$function(null, null, null);
|
|
} catch (Throwable) {
|
|
}
|
|
try {
|
|
@$function(null, null, null, null);
|
|
} catch (Throwable) {
|
|
}
|
|
try {
|
|
@$function(null, null, null, null, null);
|
|
} catch (Throwable) {
|
|
}
|
|
try {
|
|
@$function(null, null, null, null, null, null);
|
|
} catch (Throwable) {
|
|
}
|
|
try {
|
|
@$function(null, null, null, null, null, null, null);
|
|
} catch (Throwable) {
|
|
}
|
|
try {
|
|
@$function(null, null, null, null, null, null, null, null);
|
|
} catch (Throwable) {
|
|
}
|
|
ob_end_clean();
|
|
}
|
|
|
|
foreach (get_defined_functions()["internal"] as $function) {
|
|
test($function);
|
|
}
|
|
|
|
foreach (get_declared_classes() as $class) {
|
|
try {
|
|
$rc = new ReflectionClass($class);
|
|
$obj = $rc->newInstanceWithoutConstructor();
|
|
} catch (Throwable) {
|
|
continue;
|
|
}
|
|
|
|
foreach (get_class_methods($class) as $method) {
|
|
test([$obj, $method]);
|
|
}
|
|
}
|
|
|
|
// var_dump() and debug_zval_dump() print all arguments
|
|
?>
|
|
===DONE===
|
|
--EXPECT--
|
|
===DONE===
|