xref: /php-src/Zend/tests/named_params/assert.phpt (revision 6fb3d925)
1--TEST--
2Calling assert with named params
3--FILE--
4<?php
5
6assert(assertion: true);
7try {
8    assert(assertion: false);
9} catch (AssertionError $e) {
10    echo $e->getMessage(), "\n";
11}
12
13assert(assertion: true, description: "Description");
14try {
15    assert(assertion: false, description: "Description");
16} catch (AssertionError $e) {
17    echo $e->getMessage(), "\n";
18}
19
20try {
21    assert(description: "Description");
22} catch (Error $e) {
23    echo $e->getMessage(), "\n";
24}
25
26?>
27--EXPECT--
28assert(assertion: false)
29Description
30Named parameter $description overwrites previous argument
31