3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ReportController { protected $source; protected $data; public function __construct(array $source, \Closure $transformer, $dataObject = null) { $this->source = $source; $this->data = (isset($dataObject)) ? new stdClass() : $dataObject; var_dump('data', $this->data); $this->transform($transformer); } public function transform(\Closure $transformer) { array_walk($this->source, $transformer, $this->data); } 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());

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.0110.00416.50
8.3.50.0110.00821.98
8.3.40.0040.01118.79
8.3.30.0110.00319.23
8.3.20.0050.00320.21
8.3.10.0040.00421.90
8.3.00.0100.00019.07
8.2.180.0090.00916.50
8.2.170.0110.00422.96
8.2.160.0070.01320.53
8.2.150.0080.00024.18
8.2.140.0060.00324.66
8.2.130.0080.00026.16
8.2.120.0080.00019.66
8.2.110.0040.00720.94
8.2.100.0090.00618.22
8.2.90.0080.00019.21
8.2.80.0000.00817.97
8.2.70.0000.00817.63
8.2.60.0070.00317.93
8.2.50.0060.00318.07
8.2.40.0060.00318.16
8.2.30.0060.00318.16
8.2.20.0040.00417.89
8.2.10.0000.00818.13
8.2.00.0040.00417.82
8.1.280.0070.01025.92
8.1.270.0030.00620.64
8.1.260.0000.00826.35
8.1.250.0070.00028.09
8.1.240.0030.00621.36
8.1.230.0060.00617.42
8.1.220.0050.00317.75
8.1.210.0000.00818.77
8.1.200.0100.00017.35
8.1.190.0030.00517.10
8.1.180.0030.00518.10
8.1.170.0030.00620.91
8.1.160.0000.00722.05
8.1.150.0040.00418.91
8.1.140.0000.00917.38
8.1.130.0000.00717.86
8.1.120.0030.00717.47
8.1.110.0000.00817.37
8.1.100.0000.00717.50
8.1.90.0000.00717.43
8.1.80.0000.00717.37
8.1.70.0040.00417.52
8.1.60.0000.00817.50
8.1.50.0040.00417.50
8.1.40.0040.00417.57
8.1.30.0030.00617.53
8.1.20.0050.00317.57
8.1.10.0050.00317.60
8.1.00.0050.00217.50
8.0.300.0020.00518.77
8.0.290.0040.00416.75
8.0.280.0030.00318.25
8.0.270.0040.00417.22
8.0.260.0000.00617.21
8.0.250.0000.00716.93
8.0.240.0030.00316.95
8.0.230.0070.00316.86
8.0.220.0000.00716.82
8.0.210.0000.00716.98
8.0.200.0030.00316.99
8.0.190.0070.00017.10
8.0.180.0070.00017.06
8.0.170.0060.00317.05
8.0.160.0000.00817.01
8.0.150.0040.00416.82
8.0.140.0000.00716.96
8.0.130.0050.00013.40
8.0.120.0040.00417.00
8.0.110.0040.00416.84
8.0.100.0000.00716.95
8.0.90.0000.00716.96
8.0.80.0100.00717.01
8.0.70.0040.00416.97
8.0.60.0070.00017.00
8.0.50.0000.00816.83
8.0.30.0120.01316.99
8.0.20.0080.01417.40
8.0.10.0000.00816.95
8.0.00.0120.00816.95
7.4.330.0020.00215.03
7.4.320.0030.00316.44
7.4.300.0060.00016.52
7.4.290.0040.00716.55
7.4.280.0000.00716.66
7.4.270.0030.00316.72
7.4.260.0030.00716.56
7.4.250.0040.00416.60
7.4.240.0020.00516.63
7.4.230.0000.00716.54
7.4.220.0000.01816.71
7.4.210.0130.00716.53
7.4.200.0000.00716.69
7.4.160.0060.00916.43
7.4.150.0150.00317.40
7.4.140.0080.00917.86
7.4.130.0100.00816.50
7.4.120.0090.01016.44
7.4.110.0120.00916.46
7.4.100.0060.01216.54
7.4.90.0090.00916.63
7.4.80.0100.00519.39
7.4.70.0100.00716.45
7.4.60.0070.01016.65
7.4.50.0000.00816.23
7.4.40.0140.00316.62
7.4.30.0220.00016.51
7.4.00.0040.00814.70
7.3.330.0030.00313.44
7.3.320.0070.01113.23
7.3.310.0030.00316.40
7.3.300.0000.00616.26
7.3.290.0060.00816.38
7.3.280.0090.00716.41
7.3.270.0090.01217.40
7.3.260.0000.02016.36
7.3.250.0120.00816.56
7.3.240.0090.01416.70
7.3.230.0070.01116.64
7.3.210.0100.01016.61
7.3.200.0030.01719.39
7.3.190.0100.00716.58
7.3.180.0150.00616.40
7.3.170.0030.01416.51
7.3.160.0060.01116.34
7.3.10.0070.00716.69
7.3.00.0100.00316.61
7.2.330.0140.00316.79
7.2.320.0120.00916.68
7.2.310.0080.00816.60
7.2.300.0100.01316.40
7.2.290.0090.01516.85
7.2.130.0150.00016.95
7.2.120.0060.01016.83
7.2.110.0090.00616.89
7.2.100.0030.01316.76
7.2.90.0070.00316.96
7.2.80.0090.00916.61
7.2.70.0000.01616.98
7.2.60.0040.00916.93
7.2.50.0060.00916.93
7.2.40.0040.00817.13
7.2.30.0060.00916.95
7.2.20.0070.01116.78
7.2.10.0060.00816.79
7.2.00.0060.00616.83
7.1.250.0040.01115.91
7.1.200.0060.00915.90
7.1.70.0040.00717.23
7.1.60.0130.01019.46
7.1.50.0140.01116.93
7.1.00.0100.07022.24
7.0.200.0030.00316.81
7.0.140.0000.04721.93
7.0.70.4630.05319.93
7.0.60.0100.07719.92
7.0.50.0070.05017.93
7.0.40.0070.08020.25
7.0.30.0270.07320.23
7.0.20.0230.04720.16
7.0.10.0230.03720.23
7.0.00.0130.07320.20
5.6.280.0070.07020.93
5.6.210.0070.03720.65
5.6.200.0030.04018.16
5.6.190.0130.07720.47
5.6.180.0270.03720.49
5.6.170.0300.07020.50
5.6.160.0130.07720.46
5.6.150.0100.04018.19
5.6.140.0000.09018.21
5.6.130.0000.04318.16
5.6.120.0070.04020.95
5.6.110.0170.07021.01
5.6.100.0170.06721.01
5.6.90.0170.07721.01
5.6.80.0130.07320.41
5.6.70.0200.02720.48
5.5.350.0130.07020.39
5.5.340.0070.05718.09
5.5.330.0070.07320.56
5.5.320.0070.03720.38
5.5.310.0200.04320.41
5.5.300.0130.04718.07
5.5.290.0030.05317.94
5.5.280.0070.03720.86
5.5.270.0000.04320.80
5.5.260.0000.06720.80
5.5.250.0130.06320.59
5.5.240.0130.05720.15
5.4.450.0070.06319.17
5.4.440.0970.05019.30
5.4.430.0070.05719.68
5.4.420.0930.06019.43
5.4.410.0630.07019.45
5.4.400.0170.05018.82
5.4.390.0170.05018.71
5.4.380.0200.05018.75
5.4.370.0200.05018.80
5.4.360.0270.04718.81
5.4.350.0270.04718.61
5.4.340.0130.05718.80
5.4.320.0100.05718.78
5.4.310.0130.05318.76
5.4.300.0200.05018.63
5.4.290.0230.06718.74
5.4.280.0170.05318.83
5.4.270.0230.04318.62
5.4.260.0100.06018.46
5.4.250.0030.06718.56
5.4.240.0200.06718.75
5.4.230.0200.04718.77
5.4.220.0070.06318.88
5.4.210.0100.06018.53
5.4.200.0300.04016.61
5.4.190.0270.04718.72
5.4.180.0230.04718.51
5.4.170.0200.05318.60
5.4.160.0170.07318.74
5.4.150.0200.05018.76
5.4.140.0170.05016.35
5.4.130.0270.03716.46
5.4.120.0170.04716.30
5.4.110.0100.05316.43
5.4.100.0100.05316.33
5.4.90.0200.05016.24
5.4.80.0270.04016.21
5.4.70.0200.05016.18
5.4.60.0200.04316.27
5.4.50.0270.03716.25
5.4.40.0200.05316.39
5.4.30.0270.04016.23
5.4.20.0200.06716.20
5.4.10.0230.04316.26
5.4.00.0130.05315.83
5.3.290.0100.06014.77
5.3.280.0130.06014.60
5.3.270.0030.06714.81
5.3.260.0170.05314.90
5.3.250.0170.05014.79
5.3.240.0170.05314.71
5.3.230.0130.05714.70
5.3.220.0230.04714.68
5.3.210.0100.06014.64
5.3.200.0270.04014.86
5.3.190.0130.05314.68
5.3.180.0230.04714.55
5.3.170.0170.05014.61
5.3.160.0270.04014.76
5.3.150.0200.04714.66
5.3.140.0170.05014.76
5.3.130.0170.06014.58
5.3.120.0330.04014.64
5.3.110.0170.05314.57
5.3.100.0070.06314.11
5.3.90.0270.04014.07
5.3.80.0230.05314.06
5.3.70.0170.05314.04
5.3.60.0170.05014.14
5.3.50.0300.04313.99
5.3.40.0200.05014.02
5.3.30.0130.06314.14
5.3.20.0100.06013.71
5.3.10.0270.06013.77
5.3.00.0230.04713.78
5.2.170.0130.04311.19
5.2.160.0100.04711.28
5.2.150.0170.04011.18
5.2.140.0130.04311.22
5.2.130.0100.04711.31
5.2.120.0130.03711.15
5.2.110.0130.04011.14
5.2.100.0200.04311.21
5.2.90.0100.04311.14
5.2.80.0170.04011.15
5.2.70.0100.04711.14
5.2.60.0100.04711.18
5.2.50.0100.04310.97
5.2.40.0030.04711.03
5.2.30.0170.03710.98
5.2.20.0170.04010.98
5.2.10.0130.04010.97
5.2.00.0230.04710.76
5.1.60.0200.04010.04
5.1.50.0070.04010.03
5.1.40.0170.03010.05
5.1.30.0130.03310.52
5.1.20.0100.04010.50
5.1.10.0070.04010.26
5.1.00.0030.04310.21
5.0.50.0030.0338.58
5.0.40.0070.0278.51
5.0.30.0030.0478.24
5.0.20.0000.0338.34
5.0.10.0070.0278.27
5.0.00.0030.0478.36
4.4.90.0100.0206.02
4.4.80.0070.0205.96
4.4.70.0130.0135.88
4.4.60.0030.0235.89
4.4.50.0070.0205.93
4.4.40.0070.0335.87
4.4.30.0070.0205.88
4.4.20.0030.0275.97
4.4.10.0000.0275.97
4.4.00.0070.0375.90
4.3.110.0030.0235.82
4.3.100.0070.0205.82
4.3.90.0070.0205.79
4.3.80.0070.0335.83
4.3.70.0100.0275.82
4.3.60.0030.0235.78
4.3.50.0030.0335.80
4.3.40.0130.0275.73
4.3.30.0000.0334.57
4.3.20.0030.0304.61
4.3.10.0130.0204.56
4.3.00.0000.0237.31

preferences:
49.1 ms | 401 KiB | 5 Q