1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 08:12:21 +01:00
Files
Nikita Popov 6fb3d92525 Fixed bug #80334
If assert() was called with named args, add description as named
arg as well.
2020-11-09 10:19:32 +01:00

31 lines
580 B
PHP

--TEST--
Calling assert with named params
--FILE--
<?php
assert(assertion: true);
try {
assert(assertion: false);
} catch (AssertionError $e) {
echo $e->getMessage(), "\n";
}
assert(assertion: true, description: "Description");
try {
assert(assertion: false, description: "Description");
} catch (AssertionError $e) {
echo $e->getMessage(), "\n";
}
try {
assert(description: "Description");
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECT--
assert(assertion: false)
Description
Named parameter $description overwrites previous argument