File: source_for_branched_exec_lines_php80.php

package info (click to toggle)
php-codecoverage 9.2.26%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 19,748 kB
  • sloc: php: 11,833; javascript: 10,145; xml: 1,351; makefile: 25
file content (43 lines) | stat: -rw-r--r-- 1,483 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php

// Match
$var = 1;                           // +1
$var2 = match ($var) {              // +1
    0 => ++$var,                    // 0
    1 => ++$var,                    // 0
    default => ++$var,              // 0
};                                  // 0
$var2                               // +1
    =                               // 0
    match                           // 0
    (                               // 0
    $var                            // 0
    )                               // 0
    {                               // 0
        0                           // 0
        =>                          // 0
        ++$var                      // 0
    ,                               // 0
        1,                          // 0
        2                           // 0
        =>                          // 0
        ++$var                      // 0
    ,                               // 0
        default                     // 0
        =>                          // 0
        ++$var                      // 0
    ,                               // 0
}                                   // 0
;                                   // 0

// Nullsafe Operator
$ymd = $date?->format('Ymd');       // +1
++$var;                             // +1

// Union types
interface MyUnion
{
    public function getNameIdentifier(): ?string;
    public function hasClaim(bool|string $type, mixed $value): bool;
    public function getClaims($type1 = null): array;
}