3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private function privateMethod($x) { return $x + 1; } function publicMethod($x) { return $x + 1; } function testMap() { return array_map(array($this, 'publicMethod'), array(1,2,3)); } function testMyMap() { return my_array_map(array($this, 'publicMethod'), array(1,2,3)); } } function my_array_map($fun, $arr) { $result = array(); foreach ($arr as $k => $v) { $result[$k] = $fun($v); } return $result; } var_dump((new Foo())->testMap()); var_dump((new Foo())->testMyMap());

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.0130.00316.50
8.3.50.0070.00716.32
8.3.40.0090.00918.52
8.3.30.0110.00318.51
8.3.20.0070.00021.87
8.3.10.0040.00421.81
8.3.00.0040.00419.68
8.2.180.0090.00918.16
8.2.170.0120.00322.96
8.2.160.0070.00721.28
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0030.00622.24
8.2.120.0030.00526.35
8.2.110.0030.00622.11
8.2.100.0060.00617.70
8.2.90.0050.00319.26
8.2.80.0030.00517.97
8.2.70.0040.00417.50
8.2.60.0030.00517.93
8.2.50.0050.00318.22
8.2.40.0000.00820.46
8.2.30.0050.00319.36
8.2.20.0000.00718.20
8.2.10.0000.00718.04
8.2.00.0050.00318.13
8.1.280.0070.00725.92
8.1.270.0050.00323.97
8.1.260.0070.00026.35
8.1.250.0000.00728.09
8.1.240.0060.00320.91
8.1.230.0040.00720.90
8.1.220.0000.00817.74
8.1.210.0090.00018.77
8.1.200.0030.00617.36
8.1.190.0040.00417.23
8.1.180.0060.00318.10
8.1.170.0090.00018.52
8.1.160.0000.00718.96
8.1.150.0040.00420.06
8.1.140.0070.00019.59
8.1.130.0000.00718.91
8.1.120.0030.00617.36
8.1.110.0040.00417.52
8.1.100.0050.00317.45
8.1.90.0000.00817.41
8.1.80.0040.00417.49
8.1.70.0040.00417.35
8.1.60.0000.00717.63
8.1.50.0040.00417.46
8.1.40.0040.00417.55
8.1.30.0080.00017.65
8.1.20.0000.00917.64
8.1.10.0000.00917.50
8.1.00.0040.00417.50
8.0.300.0000.00719.98
8.0.290.0040.00416.59
8.0.280.0030.00318.40
8.0.270.0030.00317.32
8.0.260.0040.00416.77
8.0.250.0000.00817.00
8.0.240.0000.01116.94
8.0.230.0030.00716.84
8.0.220.0000.00716.83
8.0.210.0000.00716.84
8.0.200.0000.00717.00
8.0.190.0090.00016.88
8.0.180.0040.00416.93
8.0.170.0000.00716.87
8.0.160.0020.00516.87
8.0.150.0050.00216.96
8.0.140.0060.00316.76
8.0.130.0000.00513.26
8.0.120.0040.00416.88
8.0.110.0050.00216.93
8.0.100.0000.00816.99
8.0.90.0000.00716.78
8.0.80.0080.00816.87
8.0.70.0040.00416.85
8.0.60.0040.00416.87
8.0.50.0040.00416.88
8.0.30.0100.01117.11
8.0.20.0090.01017.41
8.0.10.0000.00817.07
8.0.00.0000.01716.89
7.4.330.0000.00515.55
7.4.320.0000.00616.55
7.4.300.0000.00616.55
7.4.290.0030.00616.64
7.4.280.0000.00916.62
7.4.270.0030.00316.63
7.4.260.0000.00613.34
7.4.250.0050.00316.48
7.4.240.0000.00716.55
7.4.230.0030.00316.42
7.4.220.0100.01316.54
7.4.210.0100.00316.63
7.4.200.0000.00816.57
7.4.160.0080.01016.54
7.4.150.0070.01217.40
7.4.140.0080.01017.86
7.4.130.0080.01116.40
7.4.120.0150.00616.57
7.4.110.0080.00816.65
7.4.100.0060.01316.45
7.4.90.0090.00916.59
7.4.80.0000.02119.39
7.4.70.0110.00516.36
7.4.60.0100.01116.68
7.4.50.0070.00716.42
7.4.40.0060.01116.42
7.4.30.0060.00916.54
7.4.10.0100.01015.07
7.4.00.0090.00514.78
7.3.330.0000.00513.39
7.3.320.0050.00013.24
7.3.310.0070.00016.40
7.3.300.0030.00316.30
7.3.290.0070.00816.39
7.3.280.0100.00716.36
7.3.270.0140.01117.40
7.3.260.0030.01316.57
7.3.250.0100.00816.55
7.3.240.0090.00716.62
7.3.230.0090.00816.25
7.3.210.0080.00916.50
7.3.200.0040.01516.60
7.3.190.0120.00416.49
7.3.180.0050.01316.35
7.3.170.0120.00616.41
7.3.160.0030.01316.39
7.3.130.0000.01714.79
7.3.120.0040.01415.12
7.3.110.0070.01114.80
7.3.100.0030.01014.76
7.3.90.0170.00014.64
7.3.80.0060.00914.82
7.3.70.0000.00914.98
7.3.60.0030.00914.95
7.3.50.0130.00014.64
7.3.40.0090.00315.09
7.3.30.0140.00314.91
7.3.20.0030.01016.53
7.3.10.0060.00816.58
7.3.00.0060.00616.52
7.2.330.0110.00616.64
7.2.320.0060.01316.73
7.2.310.0060.01216.49
7.2.300.0060.01016.78
7.2.290.0080.00816.38
7.2.260.0030.01615.18
7.2.250.0110.00714.61
7.2.240.0040.01115.20
7.2.230.0060.00914.94
7.2.220.0100.00315.02
7.2.210.0090.00615.18
7.2.200.0090.00015.09
7.2.190.0090.00615.02
7.2.180.0030.01015.05
7.2.170.0090.00614.79
7.2.160.0070.00715.14
7.2.150.0030.00716.79
7.2.140.0090.00616.91
7.2.130.0080.00716.89
7.2.120.0050.01216.99
7.2.110.0060.00917.04
7.2.100.0000.01216.91
7.2.90.0050.01016.80
7.2.80.0110.00617.01
7.2.70.0050.00716.76
7.2.60.0060.01016.97
7.2.50.0040.00816.76
7.2.40.0080.00517.06
7.2.30.0100.00316.83
7.2.20.0020.01016.93
7.2.10.0070.00716.84
7.2.00.0040.00917.74
7.1.330.0120.00315.96
7.1.320.0130.00015.84
7.1.310.0100.00315.77
7.1.300.0000.00915.59
7.1.290.0030.00915.85
7.1.280.0060.00615.87
7.1.270.0090.00615.82
7.1.260.0040.00815.64
7.1.250.0050.00915.71
7.1.240.0060.01115.80
7.1.230.0100.00615.67
7.1.220.0030.00915.75
7.1.210.0090.00615.98
7.1.200.0090.00315.88
7.1.190.0070.00715.91
7.1.180.0090.00615.97
7.1.170.0000.01915.74
7.1.160.0070.00315.70
7.1.150.0070.00715.91
7.1.140.0030.00615.71
7.1.130.0070.01015.65
7.1.120.0060.00615.71
7.1.110.0070.00315.64
7.1.100.0050.00817.01
7.1.90.0030.00915.83
7.1.80.0090.00315.85
7.1.70.0070.00316.46
7.1.60.0880.01324.38
7.1.50.0670.01124.40
7.1.40.0850.00924.04
7.1.30.0800.01324.19
7.1.20.0720.01224.20
7.1.10.0560.00615.29
7.1.00.0900.01215.23
7.0.330.0000.01115.37
7.0.320.0060.00315.51
7.0.310.0060.00615.41
7.0.300.0070.00415.19
7.0.290.0040.00815.40
7.0.280.0070.00715.36
7.0.270.0060.00915.53
7.0.260.0110.00315.39
7.0.250.0080.00415.42
7.0.240.0060.00615.57
7.0.230.0100.00015.22
7.0.220.0060.00915.32
7.0.210.0030.01315.57
7.0.200.0730.00715.13
7.0.190.0590.01115.13
7.0.180.0880.00615.08
7.0.170.0930.01015.05
7.0.160.0570.00514.71
7.0.150.0560.00614.79
7.0.140.0620.00514.99
7.0.130.0920.01215.18
7.0.120.0750.01514.99
7.0.110.0800.01315.08
7.0.100.0650.01515.02
7.0.90.1330.00615.03
7.0.80.0770.00514.97
7.0.70.0600.01414.96
7.0.60.0880.01314.91
7.0.50.0650.01015.10
7.0.40.0760.00914.09
7.0.30.0570.01313.96
7.0.20.0800.01014.04
7.0.10.0730.01014.19
7.0.00.0920.00714.00
5.6.400.0100.00314.38
5.6.390.0040.01114.45
5.6.380.0030.00614.08
5.6.370.0110.00714.68
5.6.360.0070.00714.57
5.6.350.0000.01414.45
5.6.340.0030.00714.18
5.6.330.0070.00714.34
5.6.320.0040.00814.39
5.6.310.0040.01114.48
5.6.300.0060.00314.38
5.6.290.0030.00914.58
5.6.280.0100.00314.35
5.6.270.0090.00814.46
5.6.260.0000.01114.25
5.6.250.0120.00314.39
5.6.240.0000.00914.49
5.6.230.0030.01014.23
5.6.220.0060.00914.43
5.6.210.0030.00914.51
5.6.200.0070.00414.76
5.6.190.0030.01014.25
5.6.180.0030.00914.63
5.6.170.0000.00914.33
5.6.160.0070.00714.45
5.6.150.0040.01114.28
5.6.140.0100.00314.21
5.6.130.0000.00914.26
5.6.120.0080.00014.54
5.6.110.0080.00014.55
5.6.100.0110.00414.18
5.6.90.0040.00814.31
5.6.80.0110.00414.53
5.6.70.0060.00914.35
5.6.60.0090.00614.27
5.6.50.0140.00314.28
5.6.40.0030.01014.49
5.6.30.0090.00614.62
5.6.20.0060.00314.21
5.6.10.0040.00714.32
5.6.00.0040.01114.50

preferences:
58.11 ms | 400 KiB | 5 Q