3v4l.org

run code in 300+ PHP versions simultaneously
<?php class myClass { public $arr = ["rose"=>"red", "violet"=>"blue", "grass"=>"green"]; } $obj = new myClass; $flowers = [0=>"rose",1=>"violet"]; $closure = function( $item ){ $arr = $this->arr; return $arr[$item]; }; foreach ($flowers as $key => $flower){ $color = $closure->call($obj,$flower); echo ucfirst("{$flower}s are $color"); echo ($key == 0)? ",\n" : " ...\n"; }

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.0000.01516.75
8.3.50.0110.00721.93
8.3.40.0070.00718.81
8.3.30.0180.00418.70
8.3.20.0080.00020.38
8.3.10.0060.00320.52
8.3.00.0000.00723.70
8.2.180.0140.00016.75
8.2.170.0040.01122.96
8.2.160.0070.00722.18
8.2.150.0040.00424.18
8.2.140.0070.00024.66
8.2.130.0080.00020.69
8.2.120.0050.00226.35
8.2.110.0030.00619.24
8.2.100.0000.01218.03
8.2.90.0000.00819.35
8.2.80.0040.00417.97
8.2.70.0060.00317.38
8.2.60.0040.00418.05
8.2.50.0030.00518.09
8.2.40.0090.00022.25
8.2.30.0070.00019.41
8.2.20.0000.00717.77
8.2.10.0070.00018.00
8.2.00.0000.00818.13
8.1.280.0150.00025.92
8.1.270.0070.00022.20
8.1.260.0040.00428.09
8.1.250.0080.00028.09
8.1.240.0090.00022.12
8.1.230.0070.00417.89
8.1.220.0090.00017.77
8.1.210.0030.00518.77
8.1.200.0060.00317.35
8.1.190.0000.00817.13
8.1.180.0000.00818.10
8.1.170.0060.00318.50
8.1.160.0070.00020.67
8.1.150.0090.00018.79
8.1.140.0050.00319.49
8.1.130.0080.00017.64
8.1.120.0000.00717.36
8.1.110.0040.00417.35
8.1.100.0030.00317.45
8.1.90.0040.00417.45
8.1.80.0030.00517.36
8.1.70.0030.00317.52
8.1.60.0040.00417.44
8.1.50.0080.00017.43
8.1.40.0040.00417.57
8.1.30.0050.00317.59
8.1.20.0040.00417.50
8.1.10.0030.00517.59
8.1.00.0030.00517.40
8.0.300.0000.00818.77
8.0.290.0000.00716.63
8.0.280.0040.00418.36
8.0.270.0030.00317.25
8.0.260.0030.00317.16
8.0.250.0000.00716.95
8.0.240.0040.00416.97
8.0.230.0030.00316.98
8.0.220.0030.00716.72
8.0.210.0040.00416.75
8.0.200.0030.00316.81
8.0.190.0050.00216.91
8.0.180.0000.00716.94
8.0.170.0000.00816.93
8.0.160.0070.00016.85
8.0.150.0000.00816.78
8.0.140.0090.00316.67
8.0.130.0000.00613.32
8.0.120.0000.00816.86
8.0.110.0000.00716.82
8.0.100.0040.00416.66
8.0.90.0030.00616.77
8.0.80.0110.00616.82
8.0.70.0080.00016.84
8.0.60.0040.00416.98
8.0.50.0050.00316.75
8.0.30.0110.00717.00
8.0.20.0100.00817.40
8.0.10.0000.00717.05
8.0.00.0110.00816.71
7.4.330.0020.00216.67
7.4.320.0030.00316.51
7.4.300.0050.00316.56
7.4.290.0030.00316.59
7.4.280.0040.00416.60
7.4.270.0040.00416.51
7.4.260.0030.00316.54
7.4.250.0050.00316.38
7.4.240.0000.00716.60
7.4.230.0000.00716.69
7.4.220.0060.01316.53
7.4.210.0030.01116.66
7.4.200.0070.00016.50
7.4.160.0060.00916.47
7.4.150.0110.00617.40
7.4.140.0120.00617.86
7.4.130.0100.00816.52
7.4.120.0100.00916.46
7.4.110.0090.00916.31
7.4.100.0090.00616.54
7.4.90.0060.01216.56
7.4.80.0090.00919.39
7.4.70.0100.01016.63
7.4.60.0060.01016.48
7.4.50.0070.00716.62
7.4.40.0080.00816.49
7.4.30.0060.01216.28
7.4.00.0070.01014.80
7.3.330.0050.00013.34
7.3.320.0030.00313.20
7.3.310.0040.00416.40
7.3.300.0000.00616.40
7.3.290.0080.00816.41
7.3.280.0060.01216.38
7.3.270.0060.01217.40
7.3.260.0110.01216.41
7.3.250.0080.01016.34
7.3.240.0130.00416.58
7.3.230.0090.00916.39
7.3.210.0130.00416.65
7.3.200.0070.01019.39
7.3.190.0140.00316.55
7.3.180.0060.01016.23
7.3.170.0070.01416.53
7.3.160.0060.00916.27
7.3.120.0090.00914.73
7.3.110.0070.01115.12
7.3.100.0090.00814.85
7.3.90.0040.01014.88
7.3.80.0070.00714.76
7.3.70.0070.00714.85
7.3.60.0070.00614.79
7.3.50.0060.00714.88
7.3.40.0030.00814.80
7.3.30.0020.01014.84
7.3.20.0040.00716.63
7.3.10.0050.00716.35
7.3.00.0090.00616.53
7.2.330.0110.00716.45
7.2.320.0130.00616.83
7.2.310.0070.01116.53
7.2.300.0060.01216.62
7.2.290.0060.01016.85
7.2.250.0100.00914.96
7.2.240.0080.01015.16
7.2.230.0070.00915.11
7.2.220.0100.00415.01
7.2.210.0030.01115.06
7.2.200.0030.00815.13
7.2.190.0070.00715.12
7.2.180.0060.00814.99
7.2.170.0060.00714.79
7.2.160.0050.00914.85
7.2.150.0060.00617.00
7.2.140.0070.00916.80
7.2.130.0080.00816.75
7.2.120.0000.01416.93
7.2.110.0050.00816.72
7.2.100.0030.00916.85
7.2.90.0110.00516.91
7.2.80.0050.00617.00
7.2.70.0050.00917.03
7.2.60.0090.00816.88
7.2.50.0070.00717.00
7.2.40.0080.00916.97
7.2.30.0050.01016.96
7.2.20.0080.00817.05
7.2.10.0090.00616.95
7.2.00.0050.00816.95
7.1.330.0070.01015.81
7.1.320.0090.00615.88
7.1.310.0070.00515.88
7.1.300.0070.00615.66
7.1.290.0060.00715.79
7.1.280.0060.00815.92
7.1.270.0040.00915.57
7.1.260.0070.00615.63
7.1.250.0090.00715.79
7.1.240.0080.00615.67
7.1.230.0040.00715.89
7.1.220.0110.00315.62
7.1.210.0060.00715.71
7.1.200.0060.00615.82
7.1.190.0040.00715.92
7.1.180.0080.00715.84
7.1.170.0060.00915.71
7.1.160.0050.00815.78
7.1.150.0080.00615.93
7.1.140.0060.00815.76
7.1.130.0030.00915.94
7.1.120.0050.00715.89
7.1.110.0030.01015.86
7.1.100.0060.00415.90
7.1.90.0030.00615.75
7.1.80.0020.01215.93
7.1.70.0050.00816.26
7.1.60.0080.01017.06
7.1.50.0010.01216.26
7.1.40.0020.00915.89
7.1.30.0030.00815.79
7.1.20.0050.00615.94
7.1.10.0050.00715.89
7.1.00.0080.02818.08
7.0.330.0050.00915.34
7.0.320.0060.00615.18
7.0.310.0060.00615.41
7.0.300.0070.00615.25
7.0.290.0050.00715.53
7.0.280.0070.00715.26
7.0.270.0030.00915.39
7.0.260.0050.00815.30
7.0.250.0040.00915.23
7.0.240.0070.00615.29
7.0.230.0050.00715.38
7.0.220.0020.01315.44
7.0.210.0050.00815.43
7.0.200.0190.00415.20
7.0.190.0030.00815.46
7.0.180.0030.00815.38
7.0.170.0020.01115.26
7.0.160.0060.00915.37
7.0.150.0070.00715.53
7.0.140.0070.00715.44
7.0.130.0090.00515.27
7.0.120.0070.00515.39
7.0.110.0020.01115.45
7.0.100.0060.00515.37
7.0.90.0020.01115.34
7.0.80.0030.00715.30
7.0.70.0020.01515.42
7.0.60.0110.03017.55
7.0.50.0040.03116.25
7.0.40.0060.02015.83
7.0.30.0160.02615.74
7.0.20.0200.02515.69
7.0.10.0050.01615.68
7.0.00.0030.02115.66
5.6.400.0060.00914.14
5.6.390.0050.01014.49
5.6.380.0050.00814.35
5.6.370.0100.00514.42
5.6.360.0050.00514.49
5.6.350.0070.00514.51
5.6.340.0060.00814.08
5.6.330.0110.00214.21
5.6.320.0060.00714.40
5.6.310.0080.00614.42
5.6.300.0040.01014.49
5.6.290.0090.00414.43
5.6.280.0030.01716.68
5.6.270.0080.00614.53
5.6.260.0040.01114.11
5.6.250.0040.01314.46
5.6.240.0090.00314.11
5.6.230.0040.00514.16
5.6.220.0080.00214.17
5.6.210.0030.03416.38
5.6.200.0060.03215.58
5.6.190.0070.02116.42
5.6.180.0170.01316.41
5.6.170.0110.02516.30
5.6.160.0100.02016.23
5.6.150.0110.02815.53
5.6.140.0080.02615.68
5.6.130.0080.01815.54
5.6.120.0040.03316.52
5.6.110.0070.03116.56
5.6.100.0050.02616.64
5.6.90.0090.02416.56
5.6.80.0080.02816.33
5.6.70.0080.00714.04
5.6.60.0040.00714.17
5.6.50.0030.00614.28
5.6.40.0070.00614.06
5.6.30.0080.00714.35
5.6.20.0070.00814.22
5.6.10.0060.00614.30
5.6.00.0020.01114.12
5.5.380.0020.01314.33
5.5.370.0070.00714.15
5.5.360.0050.01314.16
5.5.350.0080.03316.34
5.5.340.0040.01915.57
5.5.330.0010.03716.24
5.5.320.0200.03316.31
5.5.310.0160.02216.35
5.5.300.0020.02115.49
5.5.290.0020.02515.46
5.5.280.0070.02816.25
5.5.270.0100.02716.47
5.5.260.0070.02116.66
5.5.250.0050.01916.35
5.5.240.0110.02416.13
5.5.230.0040.00914.25
5.5.220.0040.00714.32
5.5.210.0080.00314.34
5.5.200.0040.01214.19
5.5.190.0050.00614.15
5.5.180.0100.00514.30
5.5.170.0060.00614.22
5.5.160.0070.00414.19
5.5.150.0030.01114.24
5.5.140.0050.00814.23
5.5.130.0030.00914.34
5.5.120.0060.00514.30
5.5.110.0060.00814.30
5.5.100.0050.00614.35
5.5.90.0030.01014.05
5.5.80.0040.01114.14
5.5.70.0080.00514.08
5.5.60.0090.00514.01
5.5.50.0050.00714.15
5.5.40.0080.00314.10
5.5.30.0050.00814.18
5.5.20.0040.00714.30
5.5.10.0050.00914.03
5.5.00.0050.00914.10

preferences:
49.33 ms | 401 KiB | 5 Q