3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Bicycle { protected $condition_id; protected const CONDITION_OPTIONS = [ 1 => 'Beat up', 2 => 'Decent', 3 => 'Good', 4 => 'Great', 5 => 'Like New' ]; public function __construct($arg=[]){ $this->condition_id = $arg['condition_id'] ?? 3; } public function condition(){ if($this->condition_id > 0){ return self::CONDITION_OPTIONS[$this->condition_id]; }else{ return "Unknown"; } } } $arg = ['condition_id' => 2]; $bike = new Bicycle($arg); echo $bike->condition();

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.0120.00816.55
8.5.00.0130.00819.80
8.4.160.0030.00823.93
8.4.150.0030.00014.05
8.4.140.0120.00917.52
8.4.130.0110.00917.76
8.4.120.0130.00520.58
8.4.110.0160.00622.77
8.4.100.0120.00917.91
8.4.90.0060.00318.05
8.4.80.0080.00317.82
8.4.70.0110.01119.52
8.4.60.0040.00518.90
8.4.50.0030.00518.81
8.4.40.0070.01017.57
8.4.30.0060.00317.55
8.4.20.0090.00617.60
8.4.10.0030.00619.42
8.3.280.0160.00718.32
8.3.270.0120.00816.54
8.3.260.0100.00916.66
8.3.250.0100.00919.06
8.3.240.0110.00816.59
8.3.230.0080.01116.43
8.3.220.0120.00716.51
8.3.210.0150.00416.65
8.3.200.0020.00616.60
8.3.190.0110.00716.83
8.3.180.0120.00716.92
8.3.170.0130.00720.54
8.3.160.0140.00416.59
8.3.150.0100.01017.33
8.3.140.0110.00716.69
8.3.130.0040.00418.55
8.3.120.0000.01018.91
8.3.110.0030.00620.94
8.3.100.0030.00624.06
8.3.90.0040.00426.77
8.3.80.0030.00618.31
8.3.70.0070.01418.43
8.3.60.0090.00618.55
8.3.50.0100.00718.21
8.3.40.0130.00618.65
8.3.30.0060.00918.87
8.3.20.0030.00618.86
8.3.10.0080.00021.72
8.3.00.0040.00423.53
8.2.290.0080.01020.71
8.2.280.0080.01118.54
8.2.270.0110.00817.00
8.2.260.0030.00520.54
8.2.250.0090.00016.48
8.2.240.0040.00418.80
8.2.230.0060.00322.58
8.2.220.0060.00337.54
8.2.210.0080.00026.77
8.2.200.0060.00318.05
8.2.190.0120.00318.16
8.2.180.0070.00718.29
8.2.170.0090.00618.91
8.2.160.0100.00322.96
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0000.00720.35
8.2.120.0040.00426.35
8.2.110.0110.00321.04
8.2.100.0120.00017.72
8.2.90.0040.00418.03
8.2.80.0030.00617.97
8.2.70.0030.00617.79
8.2.60.0000.00918.04
8.2.50.0090.00018.10
8.2.40.0070.00019.36
8.2.30.0040.00419.29
8.2.20.0030.00518.17
8.2.10.0000.00819.89
8.2.00.0070.00019.35
8.1.330.0030.00523.90
8.1.320.0120.00718.34
8.1.310.0050.00315.94
8.1.300.0040.00418.50
8.1.290.0060.00330.84
8.1.280.0070.00725.92
8.1.270.0030.00622.01
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0100.00722.60
8.1.230.0070.00420.97
8.1.220.0060.00317.74
8.1.210.0090.00018.91
8.1.200.0030.00617.23
8.1.190.0080.00017.35
8.1.180.0040.00418.10
8.1.170.0000.00818.78
8.1.160.0000.00718.83
8.1.150.0000.00718.88
8.1.140.0040.00417.70
8.1.130.0030.00318.95
8.1.120.0080.00017.30
8.1.110.0000.00717.38
8.1.100.0030.00517.32
8.1.90.0040.00417.29
8.1.80.0070.00017.29
8.1.70.0040.00417.33
8.1.60.0000.00917.55
8.1.50.0000.00817.55
8.1.40.0030.00517.49
8.1.30.0030.00617.60
8.1.20.0000.00817.67
8.1.10.0000.00817.61
8.1.00.0040.00417.44
8.0.300.0000.00719.98
8.0.290.0000.00916.63
8.0.280.0030.00318.37
8.0.270.0070.00017.27
8.0.260.0000.00717.23
8.0.250.0000.00716.94
8.0.240.0070.00016.89
8.0.230.0030.00616.93
8.0.220.0000.00716.82
8.0.210.0030.00316.69
8.0.200.0030.00316.90
8.0.190.0000.00716.76
8.0.180.0070.00016.86
8.0.170.0070.00316.83
8.0.160.0040.00716.68
8.0.150.0000.00716.78
8.0.140.0030.00616.80
8.0.130.0070.00013.25
8.0.120.0070.00016.70
8.0.110.0000.00816.91
8.0.100.0030.00616.63
8.0.90.0000.00716.82
8.0.80.0070.01416.74
8.0.70.0000.00716.89
8.0.60.0070.00016.70
8.0.50.0070.00016.84
8.0.30.0050.01317.27
8.0.20.0100.00817.40
8.0.10.0000.00716.88
8.0.00.0140.00416.80
7.4.330.0030.00316.73
7.4.320.0000.00616.59
7.4.300.0070.00016.41
7.4.290.0060.00316.50
7.4.280.0000.00716.39
7.4.270.0030.00316.50
7.4.260.0000.00716.52
7.4.250.0070.00316.57
7.4.240.0000.00716.55
7.4.230.0000.00716.54
7.4.220.0040.00416.71
7.4.210.0030.01116.48
7.4.200.0060.00316.49
7.4.160.0060.00916.45
7.4.140.0110.00717.86
7.4.130.0100.00716.32
7.4.120.0120.00716.50
7.4.110.0100.00616.30
7.4.100.0060.01016.44
7.4.90.0210.00316.26
7.4.80.0150.00319.39
7.4.70.0090.00816.60
7.4.60.0090.00616.51
7.4.50.0070.01016.32
7.4.40.0070.01416.30
7.4.00.0130.00314.95
7.3.330.0020.00213.20
7.3.320.0060.00013.35
7.3.310.0070.00016.41
7.3.300.0030.00316.25
7.3.290.0000.00716.25
7.3.280.0160.00816.37
7.3.260.0090.00916.37
7.3.240.0090.00916.46
7.3.230.0140.00416.41
7.3.210.0050.01616.41
7.3.200.0000.01716.34
7.3.190.0170.00016.38
7.3.180.0140.00716.29
7.3.170.0140.00416.32
7.3.160.0120.00416.51
7.2.330.0120.01216.66
7.2.320.0080.01216.75
7.2.310.0100.01416.79
7.2.300.0040.01216.67
7.2.290.0060.01216.55
7.2.80.0090.00316.64
7.2.70.0090.00616.97
7.2.60.0050.00916.94
7.2.50.0100.01016.71
7.2.40.0030.01016.57
7.2.30.0050.00916.97
7.2.20.0110.00316.96
7.2.10.0130.00416.82
7.2.00.0060.00916.83
7.1.200.0060.00915.68
7.1.170.0040.01315.62
7.1.160.0130.00315.74
7.1.150.0030.01015.63
7.1.140.0040.00815.34
7.1.130.0140.00015.59
7.1.120.0000.01315.54
7.1.110.0070.01015.63
7.1.100.0120.00615.68
7.1.90.0060.00615.53
7.1.80.0030.00915.55
7.1.70.0040.00815.59
7.1.60.0260.01033.40
7.1.50.0270.01733.77
7.1.40.0270.00733.78
7.1.30.0370.00633.69
7.1.20.0220.01333.75
7.1.10.0120.00015.80
7.1.00.0060.00615.69

preferences:
171.58 ms | 403 KiB | 5 Q