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.3.60.0140.00718.43
8.3.50.0110.00416.47
8.3.40.0040.01118.87
8.3.30.0130.00721.88
8.3.20.0090.00723.27
8.3.10.0070.00923.39
8.3.00.0130.00523.76
8.2.180.0090.00925.92
8.2.170.0100.01018.87
8.2.160.0130.00722.96
8.2.150.0080.00623.64
8.2.140.0110.00523.39
8.2.130.0080.00624.24
8.2.120.0050.00823.81
8.2.110.0100.00722.10
8.2.100.0130.00620.17
8.2.90.0140.00619.45
8.2.80.0150.00819.79
8.2.70.0120.00545.90
8.2.60.0140.00619.00
8.2.50.0110.00619.28
8.2.40.0150.00519.38
8.2.30.0140.00519.02
8.2.20.0130.00518.95
8.2.10.0120.00518.95
8.2.00.0100.00418.99
8.1.280.0040.01125.92
8.1.270.0070.00723.39
8.1.260.0080.00523.81
8.1.250.0080.00524.25
8.1.240.0060.00822.53
8.1.230.0110.00421.38
8.1.220.0160.00519.68
8.1.210.0160.00519.71
8.1.200.0160.00519.08
8.1.190.0160.00419.05
8.1.180.0150.00519.17
8.1.170.0140.00719.21
8.1.160.0120.00818.98
8.1.150.0130.00518.90
8.1.140.0130.00518.91
8.1.130.0130.00518.88
8.1.120.0120.00618.59
8.1.110.0130.00418.55
8.1.100.0120.00518.49
8.1.90.0110.00618.30
8.1.80.0100.00618.24
8.1.70.0090.00618.12
8.1.60.0120.00618.44
8.1.50.0110.00518.25
8.1.40.0130.00518.14
8.1.30.0130.00618.11
8.1.20.0130.00518.02
8.1.10.0120.00617.85
8.1.00.0130.00517.74
8.0.300.0140.00719.58
8.0.290.0170.00618.70
8.0.280.0160.00618.80
8.0.270.0140.00518.48
8.0.260.0140.00518.50
8.0.250.0140.00518.33
8.0.240.0130.00518.25
8.0.230.0130.00618.02
8.0.220.0130.00417.87
8.0.210.0130.00517.85
8.0.200.0130.00417.77
8.0.190.0120.00517.82
8.0.180.0110.00517.70
8.0.170.0130.00417.55
8.0.160.0110.00517.38
8.0.150.0120.00517.24
8.0.140.0120.00517.24
8.0.130.0120.00517.14
8.0.120.0120.00517.06
8.0.110.0120.00417.14
8.0.100.0110.00517.12
8.0.90.0100.00517.05
8.0.80.0110.00517.13
8.0.70.0110.00517.09
8.0.60.0110.00517.09
8.0.50.0120.00517.10
8.0.30.0120.00417.11
8.0.20.0110.00517.17
8.0.10.0110.00517.22
8.0.00.0090.00517.22
7.4.330.0110.00418.24
7.4.320.0140.00617.98
7.4.300.0120.00417.36
7.4.290.0130.00517.40
7.4.280.0130.00517.07
7.4.270.0150.00416.90
7.4.260.0140.00416.77
7.4.250.0140.00416.78
7.4.240.0130.00516.79
7.4.230.0140.00516.76
7.4.220.0110.00516.74
7.4.210.0110.00416.73
7.4.200.0100.00516.81
7.4.190.0100.00516.77
7.4.180.0110.00516.78
7.4.160.0100.00516.77
7.4.150.0110.00516.72
7.4.140.0110.00516.65
7.4.130.0110.00516.61
7.4.120.0110.00516.61
7.4.110.0110.00516.61
7.4.100.0110.00516.69
7.4.90.0110.00516.60
7.4.80.0110.00416.62
7.4.70.0110.00416.59
7.4.60.0110.00416.63
7.4.50.0110.00516.54
7.4.40.0110.00416.55
7.4.30.0110.00416.62
7.4.20.0100.00516.59
7.4.10.0110.00416.61
7.4.00.0110.00516.63
7.3.330.0150.00416.65
7.3.320.0150.00416.58
7.3.310.0140.00416.62
7.3.300.0130.00516.56
7.3.290.0130.00416.57
7.3.280.0130.00516.55
7.3.270.0130.00416.54
7.3.260.0120.00516.55
7.3.250.0130.00416.56
7.3.240.0130.00516.56
7.3.230.0130.00516.56
7.3.220.0130.00416.51
7.3.210.0140.00416.52
7.3.200.0140.00416.52
7.3.190.0130.00416.50
7.3.180.0130.00416.51
7.3.170.0130.00416.50
7.3.160.0130.00516.49
7.3.150.0140.00416.53
7.3.140.0140.00416.52
7.3.130.0140.00416.53
7.3.120.0130.00416.49
7.3.110.0130.00516.46
7.3.100.0130.00416.46
7.3.90.0130.00416.73
7.3.80.0140.00416.52
7.3.70.0120.00516.54
7.3.60.0130.00416.60
7.3.50.0130.00516.60
7.3.40.0130.00416.59
7.3.30.0130.00516.62
7.3.20.0130.00517.79
7.3.10.0130.00517.70
7.3.00.0140.00517.74

preferences:
54.67 ms | 401 KiB | 5 Q