File: source_match_expression.php

package info (click to toggle)
php-codecoverage 11.0.9%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 32,092 kB
  • sloc: php: 12,298; javascript: 10,135; xml: 1,203; makefile: 24
file content (16 lines) | stat: -rw-r--r-- 296 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<?php declare(strict_types=1);
final class MatchExpr
{
    public int $result;

    public function __construct(int $value)
    {
        $this->result = match ($value) {
            0 => 4,
            1 => 5,
            2 => 6,
            3 => 7,
            default => 8,
        };
    }
}