3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); class User { private const STATUS_ACTIVE = 'active'; private const STATUS_INACTIVE = 'inactive'; public function __construct(public string $username, private string $status = self::STATUS_ACTIVE) { } public function setStatus(string $status): void { assert( in_array($status, [self::STATUS_ACTIVE, self::STATUS_INACTIVE]), sprintf('Le status %s n\'est pas valide. Les status possibles sont : %s', $status, implode(', ', [self::STATUS_ACTIVE, self::STATUS_INACTIVE])) ); $this->status = $status; } public function getStatus(): string { return $this->status; } } $u = new User('Greg'); var_dump($u);

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.4.10.0030.00617.72
8.3.140.0000.00816.64
8.3.130.0200.01016.95
8.3.120.0230.00716.92
8.3.110.0250.01017.07
8.3.100.0350.00822.03
8.3.90.0350.00722.22
8.3.80.0350.00622.22
8.3.70.0300.00822.07
8.3.60.0300.00822.28
8.3.50.0250.00722.07
8.3.40.0230.00622.89
8.3.30.0200.00622.86
8.3.20.0200.00623.28
8.3.10.0180.00623.42
8.3.00.0170.00623.62
8.2.260.0150.00417.37
8.2.250.0200.00417.05
8.2.240.0210.00616.72
8.2.230.0160.00817.24
8.2.220.0150.00623.45
8.2.210.0200.00422.21
8.2.200.0190.00622.36
8.2.190.0180.00822.16
8.2.180.0190.00523.04
8.2.170.0250.00722.96
8.2.160.0240.00523.26
8.2.150.0200.00623.48
8.2.140.0220.00523.30
8.2.130.0190.00623.61
8.2.120.0170.00723.46
8.2.110.0200.00522.83
8.2.100.0200.00821.97
8.2.90.0210.00621.31
8.2.80.0220.00721.67
8.2.70.0180.00538.35
8.2.60.0170.00720.85
8.2.50.0140.00520.19
8.2.40.0180.00621.07
8.2.30.0180.00520.70
8.2.20.0160.00620.59
8.2.10.0160.00520.33
8.2.00.0130.00420.03
8.1.310.0040.01518.34
8.1.300.0230.00616.16
8.1.290.0210.00723.35
8.1.280.0210.00622.82
8.1.270.0180.00723.20
8.1.260.0200.00623.42
8.1.250.0170.00623.53
8.1.240.0170.00522.96
8.1.230.0200.00522.51
8.1.220.0190.00621.52
8.1.210.0180.00521.51
8.1.200.0170.00621.01
8.1.190.0180.00420.98
8.1.180.0190.00520.84
8.1.170.0170.00720.88
8.1.160.0160.00720.59
8.1.150.0170.00620.48
8.1.140.0170.00520.43
8.1.130.0160.00620.30
8.1.120.0160.00620.07
8.1.110.0180.00520.00
8.1.100.0170.00519.84
8.1.90.0140.00619.51
8.1.80.0130.00619.40
8.1.70.0120.00619.23
8.1.60.0150.00619.60
8.1.50.0130.00619.29
8.1.40.0150.00519.13
8.1.30.0140.00618.97
8.1.20.0150.00518.75
8.1.10.0140.00618.55
8.1.00.0150.00518.42
8.0.300.0190.00721.22
8.0.290.0200.00520.61
8.0.280.0190.00520.32
8.0.270.0180.00519.98
8.0.260.0180.00619.91
8.0.250.0180.00519.75
8.0.240.0160.00619.65
8.0.230.0150.00619.38
8.0.220.0160.00419.16
8.0.210.0160.00519.15
8.0.200.0160.00418.98
8.0.190.0150.00519.02
8.0.180.0140.00518.79
8.0.170.0150.00418.56
8.0.160.0130.00518.27
8.0.150.0130.00518.03
8.0.140.0140.00618.00
8.0.130.0140.00517.85
8.0.120.0140.00517.74
8.0.110.0130.00417.82
8.0.100.0120.00617.76
8.0.90.0110.00517.65
8.0.80.0130.00417.75
8.0.70.0120.00517.73
8.0.60.0120.00517.73
8.0.50.0130.00517.73
8.0.30.0130.00517.73
8.0.20.0120.00517.80
8.0.10.0130.00517.84
8.0.00.0100.00517.84
7.4.330.0140.00419.34
7.4.320.0160.00619.40
7.4.300.0140.00418.49
7.4.290.0150.00518.54
7.4.280.0150.00517.96
7.4.270.0160.00417.68
7.4.260.0150.00517.48
7.4.250.0150.00517.49
7.4.240.0140.00517.49
7.4.230.0150.00517.44
7.4.220.0130.00517.39
7.4.210.0120.00517.39
7.4.200.0120.00517.44
7.4.190.0120.00517.42
7.4.180.0120.00517.44
7.4.160.0120.00617.41
7.4.150.0130.00517.37
7.4.140.0120.00617.30
7.4.130.0130.00517.27
7.4.120.0130.00517.26
7.4.110.0120.00517.27
7.4.100.0130.00517.34
7.4.90.0120.00517.26
7.4.80.0120.00517.28
7.4.70.0130.00417.24
7.4.60.0120.00517.28
7.4.50.0120.00517.21
7.4.40.0120.00417.22
7.4.30.0130.00417.27
7.4.20.0110.00517.25
7.4.10.0120.00517.27
7.4.00.0120.00517.28
7.3.330.0150.00517.36
7.3.320.0160.00417.33
7.3.310.0150.00417.35
7.3.300.0140.00517.27
7.3.290.0140.00417.23
7.3.280.0140.00517.21
7.3.270.0140.00417.20
7.3.260.0140.00517.21
7.3.250.0150.00417.22
7.3.240.0140.00517.23
7.3.230.0140.00517.22
7.3.220.0150.00417.17
7.3.210.0150.00417.19
7.3.200.0150.00417.18
7.3.190.0150.00417.17
7.3.180.0140.00517.17
7.3.170.0140.00517.17
7.3.160.0140.00517.16
7.3.150.0150.00417.19
7.3.140.0150.00417.19
7.3.130.0150.00417.20
7.3.120.0140.00517.16
7.3.110.0140.00517.13
7.3.100.0140.00417.13
7.3.90.0140.00417.38
7.3.80.0150.00417.19
7.3.70.0130.00517.20
7.3.60.0140.00517.26
7.3.50.0140.00517.26
7.3.40.0140.00417.25
7.3.30.0140.00517.28
7.3.20.0140.00518.42
7.3.10.0140.00518.33
7.3.00.0150.00518.37

preferences:
46.62 ms | 403 KiB | 5 Q