3v4l.org

run code in 500+ 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.5.30.0210.00918.09
8.5.20.0220.00818.18
8.5.10.0200.00916.77
8.5.00.0090.00918.29
8.4.180.0230.00919.60
8.4.170.0250.01119.86
8.4.160.0240.01019.55
8.4.150.0130.00917.82
8.4.140.0260.01017.58
8.4.130.0320.00717.52
8.4.120.0220.00819.17
8.4.110.0250.00520.04
8.4.100.0150.00517.65
8.4.90.0210.00618.21
8.4.80.0230.00918.38
8.4.70.0260.01018.14
8.4.60.0310.01018.06
8.4.50.0290.01018.10
8.4.40.0380.00817.89
8.4.30.0340.01017.44
8.4.20.0250.01117.61
8.4.10.0370.00717.53
8.3.300.0230.00819.50
8.3.290.0260.00519.54
8.3.280.0290.00818.17
8.3.270.0220.01116.66
8.3.260.0300.00616.59
8.3.250.0210.00817.84
8.3.240.0230.00816.79
8.3.230.0190.01116.54
8.3.220.0190.00717.00
8.3.210.0240.00917.17
8.3.200.0280.00816.62
8.3.190.0320.00716.79
8.3.180.0280.01016.61
8.3.170.0270.00817.09
8.3.160.0330.00617.05
8.3.150.0270.00716.80
8.3.140.0300.00816.62
8.3.130.0290.00716.77
8.3.120.0280.00816.89
8.3.110.0290.00816.50
8.3.100.0320.00817.20
8.3.90.0320.00617.45
8.3.80.0330.00716.71
8.3.70.0310.00816.65
8.3.60.0350.00816.63
8.3.50.0340.00716.70
8.3.40.0320.00817.62
8.3.30.0290.00717.64
8.3.20.0280.00718.07
8.3.10.0270.00718.09
8.3.00.0180.00818.71
8.2.300.0280.01018.94
8.2.290.0200.00718.57
8.2.280.0280.00616.96
8.2.270.0280.00916.75
8.2.260.0270.00916.65
8.2.250.0260.00816.57
8.2.240.0270.00716.71
8.2.230.0300.00716.88
8.2.220.0280.00818.48
8.2.210.0270.00817.36
8.2.200.0260.00816.73
8.2.190.0260.00616.86
8.2.180.0280.00717.42
8.2.170.0340.00718.16
8.2.160.0270.01018.11
8.2.150.0290.00818.25
8.2.140.0310.00618.14
8.2.130.0310.00818.22
8.2.120.0280.00817.79
8.2.110.0260.00718.16
8.2.100.0240.00717.83
8.2.90.0240.00917.86
8.2.80.0280.00717.52
8.2.70.0230.00638.11
8.2.60.0270.00717.53
8.2.50.0200.00717.99
8.2.40.0230.00817.81
8.2.30.0270.00517.63
8.2.20.0270.00617.50
8.2.10.0240.00717.61
8.2.00.0210.00717.65
8.1.340.0190.00917.60
8.1.330.0190.00718.43
8.1.320.0240.00716.34
8.1.310.0280.00816.35
8.1.300.0300.00816.34
8.1.290.0280.00817.55
8.1.280.0270.00917.21
8.1.270.0280.00617.91
8.1.260.0250.00618.15
8.1.250.0270.00818.30
8.1.240.0250.00817.91
8.1.230.0270.00617.65
8.1.220.0280.00617.38
8.1.210.0260.00617.44
8.1.200.0210.00917.23
8.1.190.0230.00717.13
8.1.180.0230.00717.25
8.1.170.0250.00717.32
8.1.160.0220.00817.33
8.1.150.0210.00817.32
8.1.140.0220.00717.30
8.1.130.0200.00717.34
8.1.120.0180.00717.70
8.1.110.0200.00617.48
8.1.100.0170.00617.49
8.1.90.0170.00717.44
8.1.80.0160.00517.40
8.1.70.0150.00517.41
8.1.60.0170.00517.57
8.1.50.0160.00517.51
8.1.40.0160.00617.57
8.1.30.0170.00617.65
8.1.20.0160.00617.61
8.1.10.0170.00617.56
8.1.00.0160.00717.53
8.0.300.0250.00916.98
8.0.290.0270.00716.71
8.0.280.0250.00516.87
8.0.270.0240.00716.83
8.0.260.0220.00816.79
8.0.250.0210.00517.06
8.0.240.0200.00716.97
8.0.230.0200.00716.96
8.0.220.0190.00516.84
8.0.210.0170.00616.83
8.0.200.0150.00716.86
8.0.190.0160.00516.85
8.0.180.0160.00516.83
8.0.170.0170.00416.85
8.0.160.0160.00516.89
8.0.150.0150.00616.77
8.0.140.0160.00616.78
8.0.130.0160.00516.70
8.0.120.0150.00516.40
8.0.110.0140.00616.72
8.0.100.0140.00616.70
8.0.90.0130.00616.71
8.0.80.0140.00516.70
8.0.70.0140.00516.68
8.0.60.0140.00516.68
8.0.50.0130.00616.66
8.0.30.0140.00516.71
8.0.20.0140.00416.78
8.0.10.0130.00616.84
8.0.00.0110.00516.95
7.4.330.0160.00516.36
7.4.320.0150.00616.52
7.4.300.0150.00516.47
7.4.290.0130.00516.44
7.4.280.0150.00516.45
7.4.270.0150.00616.44
7.4.260.0150.00516.37
7.4.250.0140.00616.36
7.4.240.0140.00416.34
7.4.230.0140.00516.38
7.4.220.0140.00416.34
7.4.210.0120.00516.33
7.4.200.0100.00616.36
7.4.190.0110.00516.37
7.4.180.0110.00516.43
7.4.160.0110.00516.38
7.4.150.0110.00516.31
7.4.140.0120.00516.36
7.4.130.0110.00516.24
7.4.120.0130.00416.21
7.4.110.0120.00516.22
7.4.100.0130.00416.31
7.4.90.0120.00516.24
7.4.80.0110.00516.22
7.4.70.0120.00516.22
7.4.60.0120.00516.21
7.4.50.0120.00516.16
7.4.40.0120.00516.12
7.4.30.0120.00516.21
7.4.20.0120.00416.22
7.4.10.0100.00516.20
7.4.00.0110.00516.25
7.3.330.0140.00516.33
7.3.320.0140.00616.09
7.3.310.0150.00516.21
7.3.300.0140.00516.17
7.3.290.0150.00416.19
7.3.280.0150.00416.17
7.3.270.0140.00416.16
7.3.260.0140.00416.20
7.3.250.0140.00516.19
7.3.240.0120.00616.19
7.3.230.0140.00516.19
7.3.220.0150.00416.12
7.3.210.0150.00516.12
7.3.200.0150.00416.12
7.3.190.0140.00516.11
7.3.180.0140.00516.10
7.3.170.0130.00516.11
7.3.160.0140.00416.10
7.3.150.0140.00516.10
7.3.140.0140.00516.11
7.3.130.0150.00416.19
7.3.120.0140.00416.12
7.3.110.0140.00516.03
7.3.100.0140.00516.06
7.3.90.0140.00416.32
7.3.80.0140.00516.11
7.3.70.0130.00516.17
7.3.60.0140.00516.23
7.3.50.0150.00516.26
7.3.40.0140.00516.22
7.3.30.0130.00516.23
7.3.20.0150.00517.56
7.3.10.0150.00517.48
7.3.00.0160.00517.53

preferences:
63.3 ms | 1387 KiB | 5 Q