Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions Zend/tests/named_params/internal_variadics.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,33 @@ Named params on internal functions: Variadic functions that don't support extra
try {
array_merge([1, 2], a: [3, 4]);
} catch (ArgumentCountError $e) {
echo $e->getMessage(), "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}

try {
array_diff_key([1, 2], [3, 4], a: [5, 6]);
} catch (ArgumentCountError $e) {
echo $e->getMessage(), "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}

var_dump(array_intersect(array: [1, 2]) === [1, 2]);

try {
array_intersect([1, 2], arrays: [2]);
} catch (ArgumentCountError $e) {
echo $e->getMessage(), "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}

try {
$array = [1, 2];
array_push($array, ...['values' => 3]);
} catch (ArgumentCountError $e) {
echo $e->getMessage(), "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
Internal function array_merge() does not accept named variadic arguments
Internal function array_diff_key() does not accept named variadic arguments
ArgumentCountError: Internal function array_merge() does not accept named variadic arguments
ArgumentCountError: Internal function array_diff_key() does not accept named variadic arguments
bool(true)
Internal function array_intersect() does not accept named variadic arguments
Internal function array_push() does not accept named variadic arguments
ArgumentCountError: Internal function array_intersect() does not accept named variadic arguments
ArgumentCountError: Internal function array_push() does not accept named variadic arguments
4 changes: 2 additions & 2 deletions ext/standard/tests/array/array_intersect_empty.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ var_dump(array_keys($result));
try {
array_intersect([], [], new stdClass());
} catch (TypeError $e) {
echo $e->getMessage(), "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
Expand All @@ -52,4 +52,4 @@ array(1) {
[0]=>
int(10)
}
array_intersect(): Argument #3 must be of type array, stdClass given
TypeError: array_intersect(): Argument #3 must be of type array, stdClass given
4 changes: 2 additions & 2 deletions ext/standard/tests/array/array_intersect_side_effects.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ set_error_handler(static function (int $code, string $message): bool {
try {
array_intersect([[1], [2]], ['Array'], new stdClass());
} catch (TypeError $e) {
echo $e->getMessage(), "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}

restore_error_handler();
Expand All @@ -67,4 +67,4 @@ array(2) {
[1]=>
string(4) "keep"
}
array_intersect(): Argument #3 must be of type array, stdClass given
TypeError: array_intersect(): Argument #3 must be of type array, stdClass given
12 changes: 6 additions & 6 deletions ext/standard/tests/array/array_intersect_values.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ class ThrowingStringableValue {
try {
array_intersect(['value'], [new ThrowingStringableValue(), 'value']);
} catch (RuntimeException $e) {
echo $e->getMessage(), "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}

try {
array_intersect([''], [new stdClass()]);
} catch (Error $e) {
echo $e->getMessage(), "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}

set_error_handler(static function (int $code, string $message): never {
Expand All @@ -82,7 +82,7 @@ set_error_handler(static function (int $code, string $message): never {
try {
array_intersect([[1]], [[2]]);
} catch (ErrorException $e) {
echo $e->getMessage(), "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
} finally {
restore_error_handler();
}
Expand All @@ -98,6 +98,6 @@ bool(true)
bool(true)
null,false,true,zero-float,float,resource,object
bool(true)
conversion failed
Object of class stdClass could not be converted to string
Array to string conversion
RuntimeException: conversion failed
Error: Object of class stdClass could not be converted to string
ErrorException: Array to string conversion
Loading