3v4l.org

run code in 300+ PHP versions simultaneously
<?php class myClass {} $obj = new myClass; $flowers = [0=>"rose",1=>"violet"]; $closure = function( $item ){ $arr = ["rose"=>"red", "violet"=>"blue", "grass"=>"green"]; 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.70.0090.01216.38
8.3.60.0110.00716.63
8.3.50.0100.01022.05
8.3.40.0100.01018.76
8.3.30.0000.01418.75
8.3.20.0080.00020.16
8.3.10.0040.00423.63
8.3.00.0040.00423.54
8.2.180.0070.01416.38
8.2.170.0120.00322.96
8.2.160.0180.00022.08
8.2.150.0050.00224.18
8.2.140.0050.00324.66
8.2.130.0050.00320.71
8.2.120.0070.00026.35
8.2.110.0060.00321.00
8.2.100.0090.00917.91
8.2.90.0000.00919.17
8.2.80.0060.00317.97
8.2.70.0000.00817.50
8.2.60.0040.00417.93
8.2.50.0080.00018.10
8.2.40.0040.00420.59
8.2.30.0000.00719.54
8.2.20.0080.00017.78
8.2.10.0040.00418.00
8.2.00.0000.00718.00
8.1.280.0080.00825.92
8.1.270.0040.00422.24
8.1.260.0000.00828.09
8.1.250.0040.00428.09
8.1.240.0100.00022.25
8.1.230.0120.00017.82
8.1.220.0000.00817.74
8.1.210.0000.00818.77
8.1.200.0060.00317.48
8.1.190.0090.00017.35
8.1.180.0030.00518.10
8.1.170.0040.00418.44
8.1.160.0050.00222.10
8.1.150.0000.00718.79
8.1.140.0040.00419.56
8.1.130.0000.00717.61
8.1.120.0030.00317.36
8.1.110.0000.00717.36
8.1.100.0030.00517.48
8.1.90.0030.00417.38
8.1.80.0000.00817.39
8.1.70.0030.00517.36
8.1.60.0050.00317.57
8.1.50.0030.00517.43
8.1.40.0070.00417.50
8.1.30.0000.00817.61
8.1.20.0030.00517.47
8.1.10.0040.00417.52
8.1.00.0000.00817.53
8.0.300.0000.00818.77
8.0.290.0030.00516.63
8.0.280.0000.00718.34
8.0.270.0040.00417.12
8.0.260.0060.00018.43
8.0.250.0000.00716.95
8.0.240.0040.00416.83
8.0.230.0030.00316.98
8.0.220.0060.00316.85
8.0.210.0040.00416.90
8.0.200.0000.00616.95
8.0.190.0000.00716.96
8.0.180.0030.00516.91
8.0.170.0080.00016.93
8.0.160.0030.00516.99
8.0.150.0000.00716.84
8.0.140.0040.00416.82
8.0.130.0000.00513.35
8.0.120.0030.00616.73
8.0.110.0040.00416.86
8.0.100.0000.00816.74
8.0.90.0040.00416.92
8.0.80.0040.01216.91
8.0.70.0070.00016.73
8.0.60.0000.00816.68
8.0.50.0000.00716.75
8.0.30.0070.00917.09
8.0.20.0100.01117.40
8.0.10.0000.00716.90
8.0.00.0070.01016.95
7.4.330.0000.00416.77
7.4.320.0030.00316.40
7.4.300.0000.00716.63
7.4.290.0030.00316.48
7.4.280.0000.00716.58
7.4.270.0030.00316.42
7.4.260.0030.00716.41
7.4.250.0000.00716.52
7.4.240.0050.00216.42
7.4.230.0030.00316.39
7.4.220.0110.00816.39
7.4.210.0030.01216.53
7.4.200.0030.00316.63
7.4.160.0030.01316.50
7.4.150.0120.00917.40
7.4.140.0140.00917.86
7.4.130.0130.00616.48
7.4.120.0090.00916.53
7.4.110.0100.01316.42
7.4.100.0090.01316.48
7.4.90.0140.00316.64
7.4.80.0000.01619.39
7.4.70.0170.00016.66
7.4.60.0090.00916.73
7.4.50.0070.01016.32
7.4.40.0150.00316.46
7.4.30.0070.01516.48
7.4.10.0090.00915.07
7.4.00.0050.01114.79
7.3.330.0000.00613.22
7.3.320.0060.00013.37
7.3.310.0030.00316.25
7.3.300.0040.00216.37
7.3.290.0050.00216.23
7.3.280.0090.00916.34
7.3.270.0120.00617.40
7.3.260.0120.00616.47
7.3.250.0080.01016.46
7.3.240.0120.00716.48
7.3.230.0100.01016.51
7.3.210.0090.00616.67
7.3.200.0090.00919.39
7.3.190.0140.00316.56
7.3.180.0060.01116.63
7.3.170.0090.00916.55
7.3.160.0100.00716.39
7.3.130.0130.00614.93
7.3.120.0080.00814.75
7.3.110.0030.01414.64
7.3.100.0090.00514.88
7.3.90.0070.00914.79
7.3.80.0070.00714.98
7.3.70.0040.01014.90
7.3.60.0040.00914.82
7.3.50.0090.00614.86
7.3.40.0050.00614.77
7.3.30.0050.00814.79
7.3.20.0090.00816.73
7.3.10.0110.00616.77
7.3.00.0060.00616.61
7.2.330.0090.00916.51
7.2.320.0060.01616.78
7.2.310.0090.00616.52
7.2.300.0000.01816.71
7.2.290.0060.00916.81
7.2.260.0070.01014.74
7.2.250.0070.01215.16
7.2.240.0060.01114.95
7.2.230.0030.01315.08
7.2.220.0020.01315.09
7.2.210.0070.00715.20
7.2.200.0070.00714.90
7.2.190.0030.01215.13
7.2.180.0000.01214.86
7.2.170.0100.00514.97
7.2.160.0070.00314.96
7.2.150.0030.01017.06
7.2.140.0030.01016.90
7.2.130.0030.00716.87
7.2.120.0100.00716.94
7.2.110.0070.01116.99
7.2.100.0070.01016.81
7.2.90.0070.01017.06
7.2.80.0100.00316.89
7.2.70.0040.01117.07
7.2.60.0070.00917.07
7.2.50.0030.00717.02
7.2.40.0090.00617.02
7.2.30.0110.00717.09
7.2.20.0130.00017.02
7.2.10.0090.00617.03
7.2.00.0080.00717.97
7.1.330.0060.01015.86
7.1.320.0040.00715.75
7.1.310.0090.00516.03
7.1.300.0050.00815.62
7.1.290.0060.00515.82
7.1.280.0040.00715.81
7.1.270.0080.00715.86
7.1.260.0070.00715.85
7.1.250.0030.01115.70
7.1.240.0040.01215.67
7.1.230.0040.00716.05
7.1.220.0080.00815.63
7.1.210.0110.00415.96
7.1.200.0050.00815.82
7.1.190.0000.01415.69
7.1.180.0070.00715.76
7.1.170.0000.01415.71
7.1.160.0120.00315.79
7.1.150.0060.00615.79
7.1.140.0070.00715.84
7.1.130.0040.01115.74
7.1.120.0060.00315.69
7.1.110.0070.00315.79
7.1.100.0060.00616.98
7.1.90.0070.00715.61
7.1.80.0100.00315.85
7.1.70.0050.00516.44
7.1.60.0040.01717.61
7.1.50.0030.01016.39
7.1.40.0070.00715.91
7.1.30.0090.00015.59
7.1.20.0030.00615.94
7.1.10.0070.00715.80
7.1.00.0070.03919.16
7.0.330.0060.00615.47
7.0.320.0090.00615.54
7.0.310.0060.00315.28
7.0.300.0030.01215.20
7.0.290.0080.00315.54
7.0.280.0060.00615.46
7.0.270.0040.01115.24
7.0.260.0090.00015.64
7.0.250.0000.01215.18
7.0.240.0100.00715.64
7.0.230.0030.00915.58
7.0.220.0070.00715.50
7.0.210.0040.00815.50
7.0.200.0090.00316.12
7.0.190.0040.00815.25
7.0.180.0080.00415.48
7.0.170.0000.00915.55
7.0.160.0000.01015.34
7.0.150.0090.00315.33
7.0.140.0060.00615.30
7.0.130.0100.00315.47
7.0.120.0070.01015.32
7.0.110.0060.00315.43
7.0.100.0040.00415.47
7.0.90.0050.00515.43
7.0.80.0060.00615.27
7.0.70.0040.00715.34
7.0.60.0070.04018.51
7.0.50.0070.04316.64
7.0.40.0080.03516.86
7.0.30.0140.02216.99
7.0.20.0120.02216.74
7.0.10.0110.04216.85
7.0.00.0030.02616.77
5.6.400.0060.00914.08
5.6.390.0110.00314.35
5.6.380.0070.00714.20
5.6.370.0060.00914.43
5.6.360.0070.00714.34
5.6.350.0040.01114.26
5.6.340.0110.00014.40
5.6.330.0030.01214.42
5.6.320.0090.00614.54
5.6.310.0000.01114.62
5.6.300.0100.00314.33
5.6.290.0060.00614.59
5.6.280.0020.02417.73
5.6.270.0040.01114.29
5.6.260.0000.01314.43
5.6.250.0030.01214.53
5.6.240.0100.00314.10
5.6.230.0080.00614.38
5.6.220.0040.00714.03
5.6.210.0050.04217.36
5.6.200.0070.04316.28
5.6.190.0170.03817.44
5.6.180.0150.02917.41
5.6.170.0100.04517.42
5.6.160.0100.04317.40
5.6.150.0120.01716.31
5.6.140.0070.03316.34
5.6.130.0100.04016.21
5.6.120.0070.04317.66
5.6.110.0080.04317.79
5.6.100.0090.04317.55
5.6.90.0040.02317.70
5.6.80.0150.03817.42
5.6.70.0040.01114.57
5.6.60.0080.00814.20
5.6.50.0030.00614.11
5.6.40.0060.00614.24
5.6.30.0040.01413.99
5.6.20.0070.01014.32
5.6.10.0030.00714.28
5.6.00.0000.00914.01
5.5.380.0040.01114.53
5.5.370.0000.01314.29
5.5.360.0120.00314.07
5.5.350.2150.02517.23
5.5.340.0010.02516.06
5.5.330.0070.04717.09
5.5.320.0200.02817.22
5.5.310.0050.02917.19
5.5.300.0110.04016.16
5.5.290.0070.03516.02
5.5.280.0080.03717.65
5.5.270.0030.02617.54
5.5.260.0080.04517.49
5.5.250.0030.04517.39
5.5.240.0080.03617.26
5.5.230.0060.00614.13
5.5.220.0070.00714.06
5.5.210.0060.00614.02
5.5.200.0100.00613.84
5.5.190.0030.00914.14
5.5.180.0070.00714.24
5.5.170.0060.00614.08
5.5.160.0040.00414.30
5.5.150.0040.01114.37
5.5.140.0040.00714.45
5.5.130.0030.01014.40
5.5.120.0030.01014.28
5.5.110.0100.00014.29
5.5.100.0090.00314.32
5.5.90.0030.01314.28
5.5.80.0030.01314.29
5.5.70.0030.01314.20
5.5.60.0040.01114.38
5.5.50.0000.00813.74
5.5.40.0070.00714.43
5.5.30.0080.00414.26
5.5.20.0040.00814.37
5.5.10.0070.00414.34
5.5.00.0030.00913.85

preferences:
68.85 ms | 404 KiB | 6 Q