3v4l.org

run code in 500+ 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.30.0220.00717.18
8.5.20.0250.00617.35
8.5.10.0190.00816.73
8.5.00.0240.00817.11
8.4.180.0230.01119.57
8.4.170.0240.00819.86
8.4.160.0310.01019.50
8.4.150.0220.00818.84
8.4.140.0260.00817.54
8.4.130.0290.00917.63
8.4.120.0290.00917.84
8.4.110.0310.00917.87
8.4.100.0290.01018.08
8.4.90.0290.00818.17
8.4.80.0280.00817.98
8.4.70.0310.00917.91
8.4.60.0280.00918.19
8.4.50.0280.00817.81
8.4.40.0300.00817.70
8.4.30.0310.00917.77
8.4.20.0320.00817.73
8.4.10.0330.00917.72
8.3.300.0200.00818.93
8.3.290.0280.00718.14
8.3.280.0210.00918.17
8.3.270.0260.01016.62
8.3.260.0330.00816.63
8.3.250.0270.00916.61
8.3.240.0260.00716.61
8.3.230.0240.00616.82
8.3.220.0240.00717.24
8.3.210.0270.00716.89
8.3.200.0290.00816.75
8.3.190.0300.00816.68
8.3.180.0320.00816.92
8.3.170.0350.00816.71
8.3.160.0320.00916.70
8.3.150.0300.00916.72
8.3.140.0310.00816.70
8.3.130.0260.00716.79
8.3.120.0250.00616.79
8.3.110.0260.00716.85
8.3.100.0360.00718.72
8.3.90.0330.00718.75
8.3.80.0330.00618.94
8.3.70.0310.00818.92
8.3.60.0310.00818.91
8.3.50.0290.00818.84
8.3.40.0270.00719.80
8.3.30.0230.00720.07
8.3.20.0250.00820.25
8.3.10.0230.00820.36
8.3.00.0190.00720.45
8.2.300.0370.00917.82
8.2.290.0220.00716.91
8.2.280.0250.00817.12
8.2.270.0240.00916.81
8.2.260.0280.00716.69
8.2.250.0270.00716.79
8.2.240.0240.00816.71
8.2.230.0250.00816.82
8.2.220.0240.00619.20
8.2.210.0240.00618.67
8.2.200.0240.00618.93
8.2.190.0230.00718.87
8.2.180.0240.00619.19
8.2.170.0260.00819.92
8.2.160.0270.00620.36
8.2.150.0250.00720.38
8.2.140.0260.00720.26
8.2.130.0260.00620.53
8.2.120.0240.00820.35
8.2.110.0230.00620.24
8.2.100.0230.00719.90
8.2.90.0250.00719.73
8.2.80.0250.00719.78
8.2.70.0210.00630.95
8.2.60.0210.00719.51
8.2.50.0170.00619.47
8.2.40.0210.00719.63
8.2.30.0210.00619.46
8.2.20.0210.00619.44
8.2.10.0200.00619.37
8.2.00.0160.00619.33
8.1.340.0280.01017.57
8.1.330.0230.00916.55
8.1.320.0250.00816.47
8.1.310.0240.00916.45
8.1.300.0260.00716.26
8.1.290.0240.00819.11
8.1.280.0240.00718.92
8.1.270.0230.00720.14
8.1.260.0220.00720.25
8.1.250.0220.00620.28
8.1.240.0200.00620.02
8.1.230.0230.00719.91
8.1.220.0220.00619.59
8.1.210.0210.00619.58
8.1.200.0200.00619.41
8.1.190.0210.00619.39
8.1.180.0210.00719.39
8.1.170.0200.00719.44
8.1.160.0200.00719.35
8.1.150.0200.00719.31
8.1.140.0190.00619.29
8.1.130.0200.00619.26
8.1.120.0190.00619.17
8.1.110.0190.00619.13
8.1.100.0190.00619.05
8.1.90.0170.00618.90
8.1.80.0170.00618.83
8.1.70.0160.00718.75
8.1.60.0170.00719.04
8.1.50.0170.00618.83
8.1.40.0170.00618.76
8.1.30.0170.00618.68
8.1.20.0170.00618.53
8.1.10.0160.00618.33
8.1.00.0170.00618.23
8.0.300.0220.00719.09
8.0.290.0220.00618.87
8.0.280.0220.00618.86
8.0.270.0220.00618.72
8.0.260.0210.00618.76
8.0.250.0220.00618.67
8.0.240.0190.00618.65
8.0.230.0190.00618.52
8.0.220.0190.00518.39
8.0.210.0190.00618.38
8.0.200.0190.00518.33
8.0.190.0170.00618.36
8.0.180.0160.00618.24
8.0.170.0170.00518.10
8.0.160.0160.00517.92
8.0.150.0150.00617.77
8.0.140.0160.00617.74
8.0.130.0160.00617.64
8.0.120.0150.00517.54
8.0.110.0150.00517.62
8.0.100.0140.00617.57
8.0.90.0130.00517.48
8.0.80.0150.00517.57
8.0.70.0140.00517.54
8.0.60.0140.00617.55
8.0.50.0150.00517.56
8.0.30.0150.00517.56
8.0.20.0140.00517.63
8.0.10.0140.00517.67
8.0.00.0120.00517.67
7.4.330.0170.00518.45
7.4.320.0190.00618.35
7.4.300.0160.00517.92
7.4.290.0180.00517.92
7.4.280.0160.00517.61
7.4.270.0170.00517.41
7.4.260.0160.00517.28
7.4.250.0170.00517.28
7.4.240.0160.00517.28
7.4.230.0160.00517.25
7.4.220.0140.00517.22
7.4.210.0140.00517.21
7.4.200.0130.00517.26
7.4.190.0140.00517.25
7.4.180.0140.00517.26
7.4.160.0130.00617.24
7.4.150.0140.00517.18
7.4.140.0140.00617.12
7.4.130.0140.00517.08
7.4.120.0140.00517.09
7.4.110.0140.00517.09
7.4.100.0150.00517.17
7.4.90.0130.00517.09
7.4.80.0140.00517.10
7.4.70.0140.00517.07
7.4.60.0140.00517.11
7.4.50.0140.00517.03
7.4.40.0140.00517.04
7.4.30.0150.00417.09
7.4.20.0140.00517.08
7.4.10.0140.00517.09
7.4.00.0140.00517.10
7.3.330.0160.00517.14
7.3.320.0170.00417.12
7.3.310.0170.00417.14
7.3.300.0150.00517.07
7.3.290.0150.00417.06
7.3.280.0150.00517.03
7.3.270.0150.00517.05
7.3.260.0150.00517.04
7.3.250.0160.00517.05
7.3.240.0160.00517.06
7.3.230.0150.00517.04
7.3.220.0160.00417.00
7.3.210.0160.00417.01
7.3.200.0160.00417.01
7.3.190.0160.00516.99
7.3.180.0160.00517.00
7.3.170.0150.00517.00
7.3.160.0150.00516.99
7.3.150.0160.00417.02
7.3.140.0160.00417.01
7.3.130.0160.00517.01
7.3.120.0150.00516.99
7.3.110.0150.00516.95
7.3.100.0150.00516.96
7.3.90.0150.00517.21
7.3.80.0160.00417.02
7.3.70.0150.00517.03
7.3.60.0150.00517.08
7.3.50.0160.00517.09
7.3.40.0150.00517.07
7.3.30.0150.00517.10
7.3.20.0160.00518.26
7.3.10.0150.00518.18
7.3.00.0160.00518.21

preferences:
45.69 ms | 1419 KiB | 5 Q