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.5.10.0100.00817.04
8.5.00.0190.00817.42
8.4.160.0340.01019.45
8.4.150.0230.00718.36
8.4.140.0230.00817.51
8.4.130.0270.00917.68
8.4.120.0290.00917.88
8.4.110.0300.01117.92
8.4.100.0270.01018.20
8.4.90.0300.00918.32
8.4.80.0300.01018.09
8.4.70.0300.01018.02
8.4.60.0270.00918.27
8.4.50.0260.00817.83
8.4.40.0290.00817.74
8.4.30.0300.00917.82
8.4.20.0310.00917.77
8.4.10.0320.00917.76
8.3.290.0290.00818.06
8.3.280.0230.01018.10
8.3.270.0250.01016.64
8.3.260.0310.00816.65
8.3.250.0250.01016.64
8.3.240.0260.00716.65
8.3.230.0260.00716.87
8.3.220.0260.00817.52
8.3.210.0260.00617.00
8.3.200.0280.00816.80
8.3.190.0280.00816.74
8.3.180.0320.00817.01
8.3.170.0340.00816.76
8.3.160.0320.00916.71
8.3.150.0300.00916.73
8.3.140.0320.00816.71
8.3.130.0280.00716.79
8.3.120.0260.00616.82
8.3.110.0260.00816.86
8.3.100.0370.00719.02
8.3.90.0340.00719.04
8.3.80.0340.00619.26
8.3.70.0310.00819.24
8.3.60.0320.00819.25
8.3.50.0290.00819.14
8.3.40.0270.00720.08
8.3.30.0230.00720.35
8.3.20.0250.00820.55
8.3.10.0230.00820.67
8.3.00.0180.00620.76
8.2.300.0350.01017.79
8.2.290.0190.00617.05
8.2.280.0240.00817.24
8.2.270.0230.00916.87
8.2.260.0280.00716.74
8.2.250.0270.00716.81
8.2.240.0240.00816.73
8.2.230.0240.00816.88
8.2.220.0240.00619.60
8.2.210.0250.00618.98
8.2.200.0250.00719.26
8.2.190.0240.00719.18
8.2.180.0250.00619.56
8.2.170.0260.00820.18
8.2.160.0270.00620.65
8.2.150.0260.00720.70
8.2.140.0260.00620.58
8.2.130.0260.00620.86
8.2.120.0240.00720.65
8.2.110.0230.00620.52
8.2.100.0220.00720.14
8.2.90.0250.00719.92
8.2.80.0250.00819.99
8.2.70.0210.00631.97
8.2.60.0200.00719.68
8.2.50.0170.00619.58
8.2.40.0210.00719.81
8.2.30.0210.00619.62
8.2.20.0200.00619.58
8.2.10.0190.00619.50
8.2.00.0160.00519.44
8.1.340.0310.00917.54
8.1.330.0240.01116.73
8.1.320.0260.00816.52
8.1.310.0260.00916.51
8.1.300.0280.00716.29
8.1.290.0250.00819.51
8.1.280.0250.00719.30
8.1.270.0220.00720.45
8.1.260.0210.00720.58
8.1.250.0210.00620.60
8.1.240.0200.00620.31
8.1.230.0230.00720.19
8.1.220.0220.00619.81
8.1.210.0200.00719.80
8.1.200.0200.00619.59
8.1.190.0210.00519.57
8.1.180.0200.00619.57
8.1.170.0200.00719.62
8.1.160.0190.00719.49
8.1.150.0200.00719.45
8.1.140.0190.00619.43
8.1.130.0190.00619.39
8.1.120.0180.00619.29
8.1.110.0190.00519.24
8.1.100.0190.00619.15
8.1.90.0170.00618.98
8.1.80.0160.00618.91
8.1.70.0150.00618.82
8.1.60.0170.00719.11
8.1.50.0160.00618.90
8.1.40.0170.00618.82
8.1.30.0160.00618.73
8.1.20.0170.00618.56
8.1.10.0160.00618.36
8.1.00.0160.00618.25
8.0.300.0220.00719.32
8.0.290.0220.00619.05
8.0.280.0210.00619.04
8.0.270.0210.00618.88
8.0.260.0200.00618.90
8.0.250.0210.00518.82
8.0.240.0190.00618.79
8.0.230.0190.00618.63
8.0.220.0190.00518.49
8.0.210.0180.00618.48
8.0.200.0180.00518.41
8.0.190.0170.00618.45
8.0.180.0160.00618.31
8.0.170.0170.00518.16
8.0.160.0150.00517.97
8.0.150.0150.00517.80
8.0.140.0150.00617.78
8.0.130.0150.00617.67
8.0.120.0150.00517.57
8.0.110.0150.00517.65
8.0.100.0130.00617.60
8.0.90.0130.00517.50
8.0.80.0140.00517.59
8.0.70.0140.00517.57
8.0.60.0140.00617.57
8.0.50.0150.00517.59
8.0.30.0150.00517.58
8.0.20.0140.00517.66
8.0.10.0140.00517.69
8.0.00.0110.00517.69
7.4.330.0160.00418.58
7.4.320.0180.00618.48
7.4.300.0150.00517.99
7.4.290.0170.00518.01
7.4.280.0160.00517.67
7.4.270.0170.00517.45
7.4.260.0160.00517.31
7.4.250.0160.00517.31
7.4.240.0150.00517.31
7.4.230.0160.00517.28
7.4.220.0140.00517.25
7.4.210.0140.00517.24
7.4.200.0130.00517.29
7.4.190.0130.00517.27
7.4.180.0140.00517.29
7.4.160.0130.00617.27
7.4.150.0140.00517.21
7.4.140.0130.00617.15
7.4.130.0140.00517.11
7.4.120.0140.00517.12
7.4.110.0140.00517.12
7.4.100.0140.00517.19
7.4.90.0130.00517.12
7.4.80.0130.00517.13
7.4.70.0140.00417.10
7.4.60.0140.00517.13
7.4.50.0130.00517.06
7.4.40.0140.00417.07
7.4.30.0140.00417.12
7.4.20.0130.00517.11
7.4.10.0130.00517.12
7.4.00.0130.00517.13
7.3.330.0160.00517.17
7.3.320.0170.00417.15
7.3.310.0160.00417.17
7.3.300.0150.00517.10
7.3.290.0150.00417.09
7.3.280.0150.00517.06
7.3.270.0150.00517.07
7.3.260.0150.00517.07
7.3.250.0160.00517.07
7.3.240.0150.00517.08
7.3.230.0150.00517.07
7.3.220.0160.00417.03
7.3.210.0160.00417.04
7.3.200.0160.00417.04
7.3.190.0160.00417.02
7.3.180.0150.00517.03
7.3.170.0150.00517.03
7.3.160.0150.00517.02
7.3.150.0160.00417.05
7.3.140.0160.00417.04
7.3.130.0160.00417.04
7.3.120.0150.00517.01
7.3.110.0150.00516.98
7.3.100.0150.00416.98
7.3.90.0150.00517.24
7.3.80.0160.00417.04
7.3.70.0150.00517.06
7.3.60.0150.00517.11
7.3.50.0150.00517.11
7.3.40.0150.00517.10
7.3.30.0150.00517.12
7.3.20.0160.00518.28
7.3.10.0150.00518.20
7.3.00.0160.00518.23

preferences:
39.34 ms | 403 KiB | 5 Q