3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class TestMap { public function prepare($array, $fields) { $map = $this; return array_map(function ($item) use ($map, $fields) { return $map->norm($item,$fields); }, $array ); } protected function norm($array, $fields) { unset($array['test']); } } $test = new TestMap; print_r($test->prepare(array(array('id'=>1, 'test'=>'testing')), array()));

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).
Note: hhvm uses a JIT which only kicks in after a few runs. Since we run scripts only once, hhvm always runs slower.

VersionSystem time (s)User time (s)Memory (MiB)
7.3.10.0060.01316.25
7.3.00.0150.00416.42
7.2.130.0100.00316.77
7.2.120.0030.01217.04
7.2.110.0150.00616.70
7.2.100.0140.00016.45
7.2.90.0080.01116.53
7.2.80.0160.00316.50
7.2.70.0030.01316.34
7.2.60.0110.00616.53
7.2.50.0130.00716.63
7.2.40.0170.01016.82
7.2.30.0080.01616.59
7.2.20.0060.01316.92
7.2.10.0150.00316.57
7.2.00.0070.01017.97
7.1.250.0110.00415.63
7.1.240.0070.01015.82
7.1.230.0030.00715.78
7.1.220.0100.00315.54
7.1.210.0070.01015.61
7.1.200.0060.01015.69
7.1.190.0090.00915.22
7.1.180.0070.01415.68
7.1.170.0160.00015.23
7.1.160.0060.00615.66
7.1.150.0180.00315.30
7.1.140.0130.00315.64
7.1.130.0090.00615.60
7.1.120.0090.00915.47
7.1.110.0060.00615.67
7.1.100.0120.00316.92
7.1.90.0120.00415.71
7.1.80.0120.00415.44
7.1.70.0060.00816.42
7.1.60.0120.00817.65
7.1.50.0070.01116.29
7.1.40.0080.00815.79
7.1.30.0080.00815.52
7.1.20.0040.01115.15
7.1.10.0060.00915.37
7.1.00.0100.03819.04
7.0.330.0120.00315.15
7.0.320.0150.00014.82
7.0.310.0090.01415.03
7.0.300.0150.00615.16
7.0.290.0150.00715.04
7.0.280.0160.00315.13
7.0.270.0090.00615.30
7.0.260.0130.00015.21
7.0.250.0100.00615.23
7.0.240.0110.00315.02
7.0.230.0090.00615.61
7.0.220.0120.00315.43
7.0.210.0080.00315.25
7.0.200.0040.00616.08
7.0.190.0030.00914.98
7.0.180.0070.00315.33
7.0.170.0070.00715.51
7.0.160.0070.00415.13
7.0.150.0060.01015.07
7.0.140.0070.03618.77
7.0.130.0100.00615.44
7.0.120.0120.00315.15
7.0.110.0100.00614.91
7.0.100.0100.00014.84
7.0.90.0110.00315.17
7.0.80.0070.00714.99
7.0.70.0090.00315.10
7.0.60.0070.02217.55
7.0.50.0060.02516.62
7.0.40.0080.04316.73
7.0.30.0160.05016.59
7.0.20.0220.04316.78
7.0.10.0170.04716.91
7.0.00.0080.02716.93
5.6.380.0000.01014.10
5.6.370.0040.00713.83
5.6.360.0000.01114.21
5.6.350.0030.01314.22
5.6.340.0070.00413.77
5.6.330.0000.00813.99
5.6.320.0030.01013.95
5.6.310.0070.00313.94
5.6.300.0040.00814.52
5.6.290.0100.00314.22
5.6.280.0050.04017.53
5.6.270.0000.00914.18
5.6.260.0040.00414.44
5.6.250.0070.00314.07
5.6.240.0070.01014.41
5.6.230.0030.00814.32
5.6.220.0070.00714.25
5.6.210.0080.03317.30
5.6.200.0060.02116.24
5.6.190.0070.02317.34
5.6.180.1150.02917.36
5.6.170.0280.03617.25
5.6.160.0050.03017.40
5.6.150.0080.04016.18
5.6.140.0070.02516.08
5.6.130.0030.04816.17
5.6.120.0120.02717.68
5.6.110.0060.04817.73
5.6.100.0050.03317.67
5.6.90.0080.04517.63
5.6.80.0080.04217.25
5.6.70.0070.02417.33
5.6.60.0040.01114.33
5.6.50.0000.01314.05
5.6.40.0000.01314.00
5.6.30.0030.00914.04
5.6.20.0000.01014.16
5.6.10.0060.00314.19
5.6.00.0000.01014.09
5.5.380.0000.00611.27
5.5.370.0060.00311.06
5.5.360.0090.00011.08
5.5.350.0090.04315.80
5.5.340.0080.03714.45
5.5.330.0100.04015.67
5.5.320.0020.03115.48
5.5.310.0200.04015.79
5.5.300.0050.02214.39
5.5.290.0080.04214.59
5.5.280.0060.03016.01
5.5.270.0110.03715.98
5.5.260.0080.03316.09
5.5.250.0030.04715.81
5.5.240.0020.02615.59
5.5.230.0040.00410.74
5.5.220.0030.00710.71
5.5.210.0000.00511.03
5.5.200.0030.00310.80
5.5.190.0000.00910.80
5.5.180.0000.01010.83
5.5.170.0040.00410.77
5.5.160.0030.00310.76
5.5.150.0000.00510.89
5.5.140.0040.00410.82
5.5.130.0060.00010.80
5.5.120.0030.00311.19
5.5.110.0000.00811.18
5.5.100.0030.00611.01
5.5.90.0080.00311.05
5.5.80.0040.00410.71
5.5.70.0030.00310.71
5.5.60.0040.00711.03
5.5.50.0040.00410.71
5.5.40.0060.00310.84
5.5.30.0000.00610.77
5.5.20.0000.00911.17
5.5.10.0040.00810.96
5.5.00.0080.00310.75
5.4.450.0470.02715.19
5.4.440.0400.03015.30
5.4.430.0050.03215.27
5.4.420.0330.00215.31
5.4.410.0120.03415.07
5.4.400.0100.02914.80
5.4.390.0160.02314.83
5.4.380.0150.03114.80
5.4.370.0100.02614.62
5.4.360.0100.02314.74
5.4.350.0070.01811.37
5.4.340.0020.02411.59
5.4.330.0060.00610.75
5.4.320.0030.02411.84
5.4.310.0020.02511.64
5.4.300.0040.02311.73
5.4.290.0030.03011.65
5.4.280.0070.03911.66
5.4.270.0110.03911.76
5.4.260.0080.02911.71
5.4.250.0140.06211.78
5.4.240.0110.04811.68
5.4.230.0120.03811.55
5.4.220.0050.03011.80
5.4.210.0070.03311.84
5.4.200.0070.02911.64
5.4.190.0170.05611.67
5.4.180.0100.04811.87
5.4.170.0110.03711.71
5.4.160.0070.04211.69
5.4.150.0100.03811.63
5.4.140.0070.03111.39
5.4.130.0060.04211.47
5.4.120.0090.03611.37
5.4.110.0110.04311.42
5.4.100.0090.04611.48
5.4.90.0100.04111.41
5.4.80.0080.04511.43
5.4.70.0090.04911.44
5.4.60.0180.08011.52
5.4.50.0090.07011.60
5.4.40.0070.04811.56
5.4.30.0030.03911.39
5.4.20.0130.06411.51
5.4.10.0060.02711.45
5.4.00.0070.02711.25
5.3.290.0040.02411.77
5.3.280.0070.03811.71
5.3.270.0120.04311.71
5.3.260.0080.03711.71
5.3.250.0100.03911.71
5.3.240.0110.04411.71
5.3.230.0060.03111.71
5.3.220.0080.02711.69
5.3.210.0030.03111.70
5.3.200.0090.04111.69
5.3.190.0070.04211.71
5.3.180.0060.04311.69
5.3.170.0100.04011.70
5.3.160.0070.03411.71
5.3.150.0070.04011.74
5.3.140.0100.04511.68
5.3.130.0050.04711.68
5.3.120.0040.03911.68
5.3.110.0120.06211.68
5.3.100.0090.06111.42
5.3.90.0080.05611.41
5.3.80.0050.02711.41
5.3.70.0100.04111.41
5.3.60.0040.02811.40
5.3.50.0070.04611.38
5.3.40.0050.03011.37
5.3.30.0060.03411.36
5.3.20.0160.06511.25
5.3.10.0120.03611.22
5.3.00.0110.03511.22
5.2.170.0050.0349.96
5.2.160.0050.0359.96
5.2.150.0070.0419.96
5.2.140.0040.0409.96
5.2.130.0100.0309.94
5.2.120.0060.0239.95
5.2.110.0070.0259.95
5.2.100.0110.0429.94
5.2.90.0120.0419.94
5.2.80.0090.0349.94
5.2.70.0050.0269.94
5.2.60.0070.0429.92
5.2.50.0020.0369.90
5.2.40.0050.0299.89
5.2.30.0040.0309.88
5.2.20.0040.0229.87
5.2.10.0090.0309.83
5.2.00.0040.0239.76
5.1.60.0040.0189.40
5.1.50.0050.0149.40
5.1.40.0030.0159.39
5.1.30.0050.0159.56
5.1.20.0070.0189.58
5.1.10.0030.0189.44
5.1.00.0020.0179.44
5.0.50.0020.0158.67
5.0.40.0010.0158.60
5.0.30.0040.0198.51
5.0.20.0050.0248.49
5.0.10.0080.0358.48
5.0.00.0040.0498.48
4.4.90.0020.0127.74
4.4.80.0020.0287.73
4.4.70.0070.0247.73
4.4.60.0030.0247.73
4.4.50.0030.0227.74
4.4.40.0050.0267.71
4.4.30.0050.0217.73
4.4.20.0040.0127.78
4.4.10.0020.0157.78
4.4.00.0050.0467.73
4.3.110.0020.0137.69
4.3.100.0030.0137.68
4.3.90.0020.0127.67
4.3.80.0020.0207.64
4.3.70.0040.0127.67
4.3.60.0030.0127.67
4.3.50.0060.0197.67
4.3.40.0030.0187.62
4.3.30.0020.0197.00
4.3.20.0050.0406.99
4.3.10.0000.0156.97
4.3.00.0020.0138.73