3v4l.org

run code in 300+ PHP versions simultaneously
<?php class myClass { } $obj = new myClass; $obj->color = function( $item ){ $arr = ["rose"=>"red", "violet"=>"blue", "grass"=>"green"]; return $arr[$item]; }; $flowers = [0=>"rose",1=>"violet"]; foreach ($flowers as $key => $flower){ echo "{$flower}s are ",($obj->color)($flower); 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.0120.00918.52
8.3.50.0150.00422.11
8.3.40.0120.00318.84
8.3.30.0130.00618.84
8.3.20.0090.00020.18
8.3.10.0050.00221.94
8.3.00.0000.01421.60
8.2.180.0000.01516.88
8.2.170.0110.00422.96
8.2.160.0140.00322.30
8.2.150.0000.00824.18
8.2.140.0000.00824.66
8.2.130.0000.00820.66
8.2.120.0040.00426.35
8.2.110.0030.00619.27
8.2.100.0100.00317.93
8.2.90.0040.00419.36
8.2.80.0050.00317.97
8.2.70.0040.00417.63
8.2.60.0050.00317.77
8.2.50.0080.00018.09
8.2.40.0030.00622.30
8.2.30.0030.00519.52
8.2.20.0070.00017.67
8.2.10.0000.00818.23
8.2.00.0000.00818.13
8.1.280.0130.00325.92
8.1.270.0100.01022.06
8.1.260.0070.00328.09
8.1.250.0070.00028.09
8.1.240.0090.00022.66
8.1.230.0030.00717.83
8.1.220.0060.00317.79
8.1.210.0080.00018.77
8.1.200.0050.00517.35
8.1.190.0030.00617.23
8.1.180.0040.00418.10
8.1.170.0030.00518.44
8.1.160.0030.00320.76
8.1.150.0050.00218.75
8.1.140.0030.00519.71
8.1.130.0030.00317.71
8.1.120.0000.00717.40
8.1.110.0070.00017.34
8.1.100.0070.00017.48
8.1.90.0040.00417.45
8.1.80.0040.00417.49
8.1.70.0050.00317.36
8.1.60.0060.00317.60
8.1.50.0000.00817.41
8.1.40.0030.00517.52
8.1.30.0080.00017.56
8.1.20.0000.00717.66
8.1.10.0050.00217.65
8.1.00.0040.00417.41
8.0.300.0060.00318.77
8.0.290.0090.00016.63
8.0.280.0070.00018.45
8.0.270.0050.00317.12
8.0.260.0000.00717.17
8.0.250.0000.00716.89
8.0.240.0030.00316.95
8.0.230.0000.00716.94
8.0.220.0030.00616.77
8.0.210.0030.00316.85
8.0.200.0040.00416.95
8.0.190.0000.00816.78
8.0.180.0040.00416.93
8.0.170.0000.00816.84
8.0.160.0030.00316.93
8.0.150.0070.00016.86
8.0.140.0040.00416.86
8.0.130.0050.00013.37
8.0.120.0000.00816.87
8.0.110.0000.00716.86
8.0.100.0000.00716.94
8.0.90.0060.00316.86
8.0.80.0100.01316.77
8.0.70.0040.00416.69
8.0.60.0040.00416.86
8.0.50.0040.00416.73
8.0.30.0180.01217.13
8.0.20.0090.00917.40
8.0.10.0080.00017.05
8.0.00.0070.01116.76
7.4.330.0000.00616.89
7.4.320.0000.00716.53
7.4.300.0020.00516.53
7.4.290.0000.00716.50
7.4.280.0040.00716.59
7.4.270.0000.00716.62
7.4.260.0050.00516.57
7.4.250.0000.00716.60
7.4.240.0030.00316.53
7.4.230.0070.00016.48
7.4.220.0130.00616.70
7.4.210.0090.00616.52
7.4.200.0040.00416.54
7.4.160.0050.00916.49
7.4.150.0110.00617.40
7.4.140.0110.01017.86
7.4.130.0100.00916.46
7.4.120.0050.01316.39
7.4.110.0040.01416.54
7.4.100.0070.01016.43
7.4.90.0100.00716.59
7.4.80.0150.00619.39
7.4.70.0110.00516.55
7.4.60.0100.00716.46
7.4.50.0070.00716.32
7.4.40.0070.01016.42
7.4.30.0150.00316.46
7.4.00.0070.01014.90
7.3.330.0000.00513.13
7.3.320.0030.00313.23
7.3.310.0060.00016.38
7.3.300.0030.00316.15
7.3.290.0070.00016.16
7.3.280.0090.00916.27
7.3.270.0120.00617.40
7.3.260.0030.01516.53
7.3.250.0060.01216.41
7.3.240.0080.01016.57
7.3.230.0090.00916.39
7.3.210.0030.01416.52
7.3.200.0110.00619.39
7.3.190.0070.01316.52
7.3.180.0070.01016.68
7.3.170.0120.00916.65
7.3.160.0120.00316.50
7.3.120.0070.01114.83
7.3.110.0090.00814.77
7.3.100.0120.00614.99
7.3.90.0050.01014.91
7.3.80.0070.00714.77
7.3.70.0090.00514.48
7.3.60.0050.00814.70
7.3.50.0030.01114.77
7.3.40.0030.00914.82
7.3.30.0080.00514.60
7.3.20.0070.00716.66
7.3.10.0050.00716.53
7.3.00.0030.00816.75
7.2.330.0070.01116.79
7.2.320.0080.00816.69
7.2.310.0170.00016.42
7.2.300.0030.01416.77
7.2.290.0030.01316.83
7.2.250.0070.01214.84
7.2.240.0080.01115.18
7.2.230.0080.00814.99
7.2.220.0080.00715.05
7.2.210.0080.00914.93
7.2.200.0070.00715.05
7.2.190.0030.00914.93
7.2.180.0080.00814.97
7.2.170.0060.00714.86
7.2.160.0100.00514.83
7.2.150.0080.00516.91
7.2.140.0060.00917.02
7.2.130.0030.00916.83
7.2.120.0090.00316.97
7.2.110.0040.00816.91
7.2.100.0080.00616.82
7.2.90.0070.00816.81
7.2.80.0070.00716.87
7.2.70.0070.00816.96
7.2.60.0070.00616.97
7.2.50.0060.00916.94
7.2.40.0070.00416.86
7.2.30.0040.00817.02
7.2.20.0030.01316.86
7.2.10.0030.00917.04
7.2.00.0080.00617.47
7.1.330.0050.01215.69
7.1.320.0090.00515.88
7.1.310.0090.00215.61
7.1.300.0040.00915.89
7.1.290.0080.00715.71
7.1.280.0060.00415.73
7.1.270.0060.00415.99
7.1.260.0060.00615.82
7.1.250.0070.00715.66
7.1.240.0040.00915.61
7.1.230.0040.00815.65
7.1.220.0050.00615.63
7.1.210.0070.00615.79
7.1.200.0060.00715.71
7.1.190.0100.00315.90
7.1.180.0050.00815.61
7.1.170.0060.00815.58
7.1.160.0040.00815.63
7.1.150.0030.01115.69
7.1.140.0050.00815.72
7.1.130.0030.01015.84
7.1.120.0060.00715.73
7.1.110.0060.00715.80
7.1.100.0090.00316.26
7.1.90.0050.00815.68
7.1.80.0070.00715.62
7.1.70.0070.00616.18
7.1.60.0050.00916.64
7.1.50.0070.00715.96
7.1.40.0050.00715.82
7.1.30.0020.01015.66
7.1.20.0070.00515.92
7.1.10.0050.00915.59
7.1.00.0030.02617.34
7.0.330.0040.00815.27
7.0.320.0070.00315.49
7.0.310.0070.00515.48
7.0.300.0050.00715.35
7.0.290.0050.00515.16
7.0.280.0050.00615.23
7.0.270.0060.00515.24
7.0.260.0060.00615.29
7.0.250.0050.00615.30
7.0.240.0040.00515.43
7.0.230.0030.00915.37
7.0.220.0050.00815.48
7.0.210.0020.01015.12
7.0.200.0280.00515.07
7.0.190.0070.00615.33
7.0.180.0020.01115.35
7.0.170.0030.01215.42
7.0.160.0080.00515.59
7.0.150.0050.00715.32
7.0.140.0020.01115.39
7.0.130.0050.00715.44
7.0.120.0040.00615.29
7.0.110.0040.00815.46
7.0.100.0040.00915.31
7.0.90.0080.00515.42
7.0.80.0060.00515.33
7.0.70.0060.00515.29
7.0.60.0070.02617.06
7.0.50.0050.02616.05
7.0.40.0040.01515.06
7.0.30.0130.01315.13
7.0.20.0090.02415.21
7.0.10.0080.01915.13
7.0.00.0030.01615.16
5.6.400.0040.00614.08
5.6.390.0050.01014.11
5.6.380.0080.00614.08
5.6.370.0090.00314.04
5.6.360.0090.00414.28
5.6.350.0080.00614.04
5.6.340.0050.00914.15
5.6.330.0060.00614.18
5.6.320.0080.00414.06
5.6.310.0030.00914.21
5.6.300.0040.01214.19
5.6.290.0060.00814.13
5.6.280.0020.02015.87
5.6.270.0070.00814.29
5.6.260.0040.00714.15
5.6.250.0060.00514.12
5.6.240.0030.01013.98
5.6.230.0030.00914.14
5.6.220.0040.00814.17
5.6.210.0020.01915.78
5.6.200.0070.02515.06
5.6.190.0030.01915.76
5.6.180.0170.01915.64
5.6.170.0060.01615.75
5.6.160.0060.02815.75
5.6.150.0070.02015.17
5.6.140.0040.02115.20
5.6.130.0020.01715.02
5.6.120.0070.02215.75
5.6.110.0060.01715.74
5.6.100.0070.02215.92
5.6.90.0050.02415.75
5.6.80.0060.02115.61
5.6.70.0020.00914.04
5.6.60.0070.00313.95
5.6.50.0070.00714.04
5.6.40.0080.00414.11
5.6.30.0080.00514.03
5.6.20.0070.00614.10
5.6.10.0050.00913.92
5.6.00.0070.00314.07
5.5.380.0090.00313.11
5.5.370.0060.00613.14
5.5.360.0050.00613.06
5.5.350.0100.02314.79
5.5.340.0080.02114.28
5.5.330.0060.01414.68
5.5.320.0170.02114.86
5.5.310.0080.01514.86
5.5.300.0040.01614.33
5.5.290.0040.01614.26
5.5.280.0080.02214.97
5.5.270.0030.02714.81
5.5.260.0060.01915.00
5.5.250.0030.02615.03
5.5.240.0080.01314.79
5.5.230.0040.00712.81
5.5.220.0010.01012.99
5.5.210.0040.00812.94
5.5.200.0070.00412.85
5.5.190.0040.00813.07
5.5.180.0040.00712.94
5.5.170.0070.00312.99
5.5.160.0030.00713.00
5.5.150.0040.00713.07
5.5.140.0080.00612.90
5.5.130.0030.00813.00
5.5.120.0090.00313.03
5.5.110.0050.00713.05
5.5.100.0050.00612.78
5.5.90.0060.00612.84
5.5.80.0030.01112.95
5.5.70.0040.00712.94
5.5.60.0040.00812.92
5.5.50.0050.00812.89
5.5.40.0050.00312.78
5.5.30.0040.00713.02
5.5.20.0030.00712.88
5.5.10.0030.00912.97
5.5.00.0060.00512.92

preferences:
101.53 ms | 401 KiB | 5 Q