3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); class User { public const STATUS_ACTIVE = 'active'; public const STATUS_INACTIVE = 'inactive'; public function __construct(public string $username, public string $status = self::STATUS_ACTIVE) { } } class Admin extends User { // ... public function printStatus() { // vous pouvez accéder au status comme si la propriété appartenait à Admin :) echo $this->status; } } $admin = new Admin('Lily'); $admin->printStatus();

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.140.0120.00617.37
8.3.130.0280.00417.22
8.3.120.0230.00717.91
8.3.110.0250.00716.44
8.3.100.0180.00818.88
8.3.90.0270.00119.82
8.3.80.0240.00617.34
8.3.70.0220.01016.78
8.3.60.0350.00416.82
8.3.50.0250.00817.02
8.3.40.0280.00717.87
8.3.30.0250.00617.85
8.3.20.0230.00519.17
8.3.10.0220.00319.38
8.3.00.0120.00720.26
8.2.250.0170.00816.59
8.2.240.0230.00517.19
8.2.230.0240.00817.99
8.2.220.0230.00623.56
8.2.210.0160.01019.74
8.2.200.0200.00417.17
8.2.190.0190.00317.41
8.2.180.0220.00719.09
8.2.170.0330.00719.04
8.2.160.0220.01119.07
8.2.150.0250.00719.67
8.2.140.0290.00319.42
8.2.130.0270.00719.71
8.2.120.0220.00618.50
8.2.110.0170.00719.05
8.2.100.0200.00618.13
8.2.90.0200.00818.43
8.2.80.0250.00317.65
8.2.70.0160.00554.64
8.2.60.0220.00717.69
8.2.50.0120.00618.49
8.2.40.0140.00718.19
8.2.30.0180.00417.87
8.2.20.0200.00417.63
8.2.10.0150.00717.87
8.2.00.0150.00617.90
8.1.300.0240.00816.70
8.1.290.0190.00821.06
8.1.280.0230.00719.06
8.1.270.0220.00619.09
8.1.260.0180.00719.78
8.1.250.0230.00820.18
8.1.240.0220.00519.02
8.1.230.0230.00418.29
8.1.220.0270.00317.54
8.1.210.0220.00717.89
8.1.200.0170.01017.33
8.1.190.0160.00717.31
8.1.180.0160.00417.49
8.1.170.0200.00517.69
8.1.160.0180.00717.56
8.1.150.0110.00717.59
8.1.140.0160.00417.55
8.1.130.0130.00517.55
8.1.120.0120.00518.05
8.1.110.0130.00617.71
8.1.100.0130.00517.62
8.1.90.0120.00617.56
8.1.80.0110.00517.49
8.1.70.0110.00417.49
8.1.60.0130.00617.65
8.1.50.0130.00517.58
8.1.40.0140.00517.64
8.1.30.0140.00517.71
8.1.20.0130.00517.67
8.1.10.0130.00617.60
8.1.00.0130.00617.59
8.0.300.0170.00917.69
8.0.290.0230.00516.96
8.0.280.0190.00317.15
8.0.270.0160.00717.09
8.0.260.0160.00817.00
8.0.250.0160.00517.35
8.0.240.0140.00617.20
8.0.230.0140.00617.12
8.0.220.0150.00516.97
8.0.210.0130.00416.94
8.0.200.0100.00716.95
8.0.190.0110.00516.93
8.0.180.0120.00516.90
8.0.170.0130.00416.92
8.0.160.0130.00516.96
8.0.150.0120.00516.83
8.0.140.0120.00616.86
8.0.130.0130.00416.73
8.0.120.0120.00416.37
8.0.110.0110.00616.77
8.0.100.0110.00516.74
8.0.90.0100.00616.75
8.0.80.0110.00516.74
8.0.70.0120.00416.71
8.0.60.0110.00516.74
8.0.50.0100.00616.71
8.0.30.0120.00516.73
8.0.20.0120.00416.82
8.0.10.0110.00516.87
8.0.00.0090.00516.99
7.4.330.0120.00516.39
7.4.320.0100.00516.66
7.4.300.0120.00416.52
7.4.290.0110.00516.48
7.4.280.0130.00516.50
7.4.270.0120.00616.48
7.4.260.0130.00516.40
7.4.250.0120.00516.38
7.4.240.0120.00416.36
7.4.230.0120.00416.42
7.4.220.0110.00416.36
7.4.210.0090.00516.35
7.4.200.0080.00516.38
7.4.190.0080.00516.38
7.4.180.0090.00516.44
7.4.160.0090.00516.40
7.4.150.0090.00516.33
7.4.140.0090.00516.37
7.4.130.0090.00416.24
7.4.120.0100.00416.21
7.4.110.0090.00516.23
7.4.100.0100.00416.32
7.4.90.0090.00516.26
7.4.80.0090.00516.23
7.4.70.0090.00516.24
7.4.60.0090.00516.21
7.4.50.0100.00416.16
7.4.40.0090.00516.13
7.4.30.0090.00416.21
7.4.20.0090.00416.21
7.4.10.0080.00516.19
7.4.00.0090.00516.27
7.3.330.0120.00416.36
7.3.320.0110.00516.08
7.3.310.0130.00416.23
7.3.300.0120.00416.17
7.3.290.0120.00316.20
7.3.280.0130.00416.18
7.3.270.0120.00416.18
7.3.260.0120.00416.20
7.3.250.0110.00516.21
7.3.240.0100.00616.20
7.3.230.0120.00416.19
7.3.220.0120.00416.13
7.3.210.0120.00416.14
7.3.200.0120.00416.12
7.3.190.0110.00516.12
7.3.180.0110.00516.11
7.3.170.0110.00516.12
7.3.160.0120.00416.10
7.3.150.0110.00516.10
7.3.140.0120.00416.13
7.3.130.0120.00416.20
7.3.120.0110.00416.14
7.3.110.0120.00516.05
7.3.100.0110.00516.06
7.3.90.0120.00416.36
7.3.80.0110.00516.12
7.3.70.0110.00516.18
7.3.60.0110.00516.25
7.3.50.0120.00416.29
7.3.40.0110.00516.23
7.3.30.0110.00516.23
7.3.20.0120.00517.56
7.3.10.0120.00517.48
7.3.00.0130.00417.53

preferences:
54.04 ms | 403 KiB | 5 Q