forked from sebastianbergmann/php-code-coverage
-
Notifications
You must be signed in to change notification settings - Fork 0
/
source_for_branched_exec_lines_php80.php
43 lines (40 loc) · 1.45 KB
/
source_for_branched_exec_lines_php80.php
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;
}