3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class ReportController { protected $source; protected $data; public function __construct(array $source, \Closure $transformer, $dataObject = null) { $this->source = $source; $this->data = ($dataObject) ? new stdClass() : $dataObject; $this->transform($transformer); } public function transform(\Closure $transformer) { array_walk($this->source, $transformer, "bob"); } public function getData() { return $this->data; } } $source = [ ['type'=>'open'], ['type'=>'closed'], ['type'=>'pending'], ['type'=>'accepted'] ]; $transformer = function($ticket, $key, $data) { var_dump($key, $data); (isset($data[$ticket['type']]))? $data[$ticket['type']]++: $data[$ticket['type']]=1; }; $report = new ReportController($source, $transformer); var_dump($report->getData());
based on n8XaY

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.2.60.0100.00616.92
7.2.00.0060.00819.65
7.1.200.0040.00815.90
7.1.100.0030.00718.45
7.1.70.0000.01017.16
7.1.60.0070.01419.46
7.1.50.0030.02117.05
7.1.00.0070.07322.46
7.0.200.0070.00716.88
7.0.140.0070.04321.90
7.0.70.3370.03019.91
7.0.60.0100.08319.95
7.0.50.0000.06317.88
7.0.40.0030.08720.12
7.0.30.0330.07020.06
7.0.20.0330.07720.07
7.0.10.0230.06020.24
7.0.00.0070.07020.23
5.6.280.0000.07721.05
5.6.210.0070.03720.63
5.6.200.0070.06718.16
5.6.190.0130.07720.63
5.6.180.0200.07020.61
5.6.170.0530.06320.47
5.6.160.0130.04720.61
5.6.150.0030.07018.23
5.6.140.0070.06018.17
5.6.130.0070.06318.29
5.6.120.0100.07721.05
5.6.110.0200.07321.03
5.6.100.0100.07721.14
5.6.90.0030.05721.04
5.6.80.0000.05020.52
5.6.70.0330.07020.43
5.5.350.0170.06320.54
5.5.340.0130.04017.95
5.5.330.0030.04720.21
5.5.320.0000.06320.23
5.5.310.0370.04320.28
5.5.300.0070.05018.05
5.5.290.0070.08317.94
5.5.280.0030.05720.78
5.5.270.0130.05320.80
5.5.260.0130.03020.84
5.5.250.0070.08320.55
5.5.240.0200.04720.24
5.4.450.0170.05319.55
5.4.440.0900.06019.34
5.4.430.0130.05019.19
5.4.420.0670.05719.55
5.4.410.0630.06319.48
5.4.400.0070.06318.77
5.4.390.0100.05718.56
5.4.380.0200.05318.77
5.4.370.0170.05318.78
5.4.360.0200.05718.76
5.4.350.0200.05018.47
5.4.340.0130.05318.47
5.4.320.0130.06718.62
5.4.310.0330.04018.57
5.4.300.0230.05018.47
5.4.290.0100.05718.78
5.4.280.0170.05318.62
5.4.270.0130.05718.50
5.4.260.0200.04718.58
5.4.250.0030.06718.61
5.4.240.0130.05718.70
5.4.230.0170.05018.77
5.4.220.0170.05318.75
5.4.210.0130.05318.54
5.4.200.0230.04316.55
5.4.190.0170.05018.79
5.4.180.0100.06018.77
5.4.170.0270.06718.79
5.4.160.0070.05718.78
5.4.150.0100.06318.55
5.4.140.0200.05016.34
5.4.130.0200.04316.32
5.4.120.0230.04016.31
5.4.110.0200.04716.45
5.4.100.0270.04316.30
5.4.90.0200.04716.27
5.4.80.0130.05016.43
5.4.70.0230.05016.40
5.4.60.0170.05016.25
5.4.50.0270.03716.24
5.4.40.0030.06316.29
5.4.30.0270.03716.16
5.4.20.0100.05716.26
5.4.10.0130.07316.25
5.4.00.0170.04715.79
5.3.290.0130.05714.79
5.3.280.0100.05714.66
5.3.270.0130.05314.70
5.3.260.0170.05314.70
5.3.250.0100.05714.63
5.3.240.0270.04314.66
5.3.230.0200.04714.66
5.3.220.0170.05014.62
5.3.210.0170.05314.78
5.3.200.0200.04714.63
5.3.190.0200.04714.62
5.3.180.0170.05014.74
5.3.170.0130.05314.74
5.3.160.0130.05314.68
5.3.150.0100.05714.74
5.3.140.0100.05714.67
5.3.130.0130.05714.64
5.3.120.0130.06314.74
5.3.110.0270.05014.73
5.3.100.0170.05014.17
5.3.90.0230.04714.09
5.3.80.0100.05714.16
5.3.70.0100.05714.11
5.3.60.0170.05014.14
5.3.50.0270.04313.99
5.3.40.0130.05713.99
5.3.30.0130.05313.95
5.3.20.0200.05013.75
5.3.10.0130.05313.78
5.3.00.0200.04713.74
5.2.170.0130.04011.19
5.2.160.0100.04311.18
5.2.150.0100.04311.14
5.2.140.0070.05011.25
5.2.130.0100.04311.23
5.2.120.0130.04011.32
5.2.110.0070.04711.14
5.2.100.0230.03711.16
5.2.90.0200.03711.21
5.2.80.0070.05311.15
5.2.70.0170.04011.11
5.2.60.0170.04011.11
5.2.50.0100.04311.08
5.2.40.0070.04311.04
5.2.30.0130.04011.11
5.2.20.0070.04711.00
5.2.10.0070.04310.94
5.2.00.0100.05010.82
5.1.60.0100.03310.13
5.1.50.0030.04010.00
5.1.40.0130.03010.01
5.1.30.0130.03310.39
5.1.20.0100.03710.39
5.1.10.0100.03310.17
5.1.00.0170.03710.15
5.0.50.0030.0338.73
5.0.40.0000.0378.43
5.0.30.0070.0408.21
5.0.20.0070.0278.22
5.0.10.0070.0278.29
5.0.00.0070.0408.29
4.4.90.0130.0136.02
4.4.80.0070.0235.96
4.4.70.0100.0175.93
4.4.60.0030.0235.91
4.4.50.0100.0175.92
4.4.40.0030.0375.92
4.4.30.0070.0205.91
4.4.20.0030.0235.94
4.4.10.0030.0275.96
4.4.00.0070.0335.96
4.3.110.0000.0275.87
4.3.100.0070.0205.90
4.3.90.0070.0205.83
4.3.80.0000.0375.81
4.3.70.0000.0235.87
4.3.60.0100.0175.81
4.3.50.0070.0205.78
4.3.40.0070.0405.77
4.3.30.0070.0204.57
4.3.20.0070.0204.62
4.3.10.0030.0234.59
4.3.00.0030.0207.31