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 = ($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.0040.01416.50
8.3.50.0070.00717.98
8.3.40.0070.00718.96
8.3.30.0110.00319.17
8.3.20.0000.00820.16
8.3.10.0050.00321.76
8.3.00.0050.00519.25
8.2.180.0140.00718.29
8.2.170.0110.00422.96
8.2.160.0170.00320.50
8.2.150.0050.00324.18
8.2.140.0000.00824.66
8.2.130.0080.00026.16
8.2.120.0040.00419.66
8.2.110.0070.00321.18
8.2.100.0040.00718.13
8.2.90.0030.00519.30
8.2.80.0040.00417.97
8.2.70.0050.00317.75
8.2.60.0060.00318.05
8.2.50.0090.00018.07
8.2.40.0040.00418.20
8.2.30.0090.00018.20
8.2.20.0080.00017.79
8.2.10.0040.00418.13
8.2.00.0000.00817.75
8.1.280.0110.00325.92
8.1.270.0090.00020.78
8.1.260.0080.00026.35
8.1.250.0080.00028.09
8.1.240.0060.00619.46
8.1.230.0070.00417.52
8.1.220.0030.00617.79
8.1.210.0040.00418.77
8.1.200.0030.00717.34
8.1.190.0040.00417.23
8.1.180.0060.00318.10
8.1.170.0040.00420.82
8.1.160.0030.00521.96
8.1.150.0000.00918.97
8.1.140.0000.00817.48
8.1.130.0070.00017.71
8.1.120.0060.00317.50
8.1.110.0040.00417.44
8.1.100.0070.00017.38
8.1.90.0040.00417.56
8.1.80.0040.00417.43
8.1.70.0030.00317.48
8.1.60.0030.00517.65
8.1.50.0060.00317.57
8.1.40.0060.00317.54
8.1.30.0030.00617.75
8.1.20.0060.00317.67
8.1.10.0030.00617.49
8.1.00.0000.00817.46
8.0.300.0080.00018.77
8.0.290.0090.00016.75
8.0.280.0040.00418.39
8.0.270.0030.00317.13
8.0.260.0000.00717.24
8.0.250.0040.00416.91
8.0.240.0000.00716.99
8.0.230.0040.00417.00
8.0.220.0000.00716.91
8.0.210.0000.00716.96
8.0.200.0030.00317.04
8.0.190.0000.00817.05
8.0.180.0080.00017.05
8.0.170.0040.00416.99
8.0.160.0000.00716.99
8.0.150.0000.00816.95
8.0.140.0050.00216.93
8.0.130.0000.00513.45
8.0.120.0040.00416.99
8.0.110.0000.00716.88
8.0.100.0040.00416.81
8.0.90.0050.00316.98
8.0.80.0130.00316.97
8.0.70.0000.00816.86
8.0.60.0040.00417.11
8.0.50.0000.00816.83
8.0.30.0170.00817.18
8.0.20.0090.01017.40
8.0.10.0000.00817.05
8.0.00.0150.00516.95
7.4.330.0050.00015.03
7.4.320.0030.00316.54
7.4.300.0030.00316.53
7.4.290.0090.00016.63
7.4.280.0040.00416.50
7.4.270.0030.00316.55
7.4.260.0100.00016.64
7.4.250.0000.00816.52
7.4.240.0030.00416.47
7.4.230.0000.00816.29
7.4.220.0060.01316.50
7.4.210.0090.00916.66
7.4.200.0030.00316.38
7.4.160.0090.00616.58
7.4.150.0190.00017.40
7.4.140.0140.00717.86
7.4.130.0110.00616.44
7.4.120.0110.00916.54
7.4.110.0060.01216.67
7.4.100.0030.02016.50
7.4.90.0040.01216.49
7.4.80.0130.00519.39
7.4.70.0060.01116.41
7.4.60.0070.01016.36
7.4.50.0000.00816.10
7.4.40.0100.00716.45
7.4.30.0100.01316.38
7.4.00.0110.00415.00
7.3.330.0000.00613.26
7.3.320.0130.00413.19
7.3.310.0000.00716.27
7.3.300.0000.00616.40
7.3.290.0120.00416.41
7.3.280.0070.01016.39
7.3.270.0140.00417.40
7.3.260.0150.01016.65
7.3.250.0100.00716.50
7.3.240.0120.00916.42
7.3.230.0080.01216.46
7.3.210.0130.00616.43
7.3.200.0140.00319.39
7.3.190.0090.00616.53
7.3.180.0070.01016.53
7.3.170.0170.00016.35
7.3.160.0110.00716.44
7.2.330.0090.00916.78
7.2.320.0070.01416.46
7.2.310.0130.00316.88
7.2.300.0110.00916.78
7.2.290.0180.00616.78
7.2.00.0030.01019.68
7.1.100.0040.00718.05
7.1.70.0000.00916.99
7.1.60.0100.01419.46
7.1.50.0090.01617.11
7.1.00.0100.07022.45
7.0.200.0040.00416.86
7.0.140.0130.05322.09
7.0.60.0070.08020.04
7.0.50.0170.04317.89
7.0.40.0130.05320.02
7.0.30.0300.05020.09
7.0.20.0270.08020.09
7.0.10.0130.07720.15
7.0.00.0070.07720.24
5.6.280.0130.06321.10
5.6.210.0100.07720.55
5.6.200.0030.04318.20
5.6.190.0100.05320.52
5.6.180.4000.04720.34
5.6.170.0230.03720.71
5.6.160.0030.04020.52
5.6.150.0000.04718.19
5.6.140.0100.07718.19
5.6.130.0030.06718.17
5.6.120.0030.07320.95
5.6.110.0100.04021.02
5.6.100.0100.04020.98
5.6.90.0130.07021.01
5.6.80.0070.07720.44
5.6.70.4370.03720.53
5.5.350.0070.07720.39
5.5.340.0070.04017.95
5.5.330.0030.05720.26
5.5.320.0400.06320.34
5.5.310.0370.06020.29
5.5.300.0100.05718.01
5.5.290.0030.08718.04
5.5.280.0070.07020.86
5.5.270.0070.07020.85
5.5.260.0130.07020.87
5.5.250.0000.04320.63
5.5.240.0000.06020.35
5.4.450.0170.06319.36
5.4.440.0770.05019.30
5.4.430.1000.05719.19
5.4.420.0670.06019.55
5.4.410.0670.07319.04
5.4.400.0070.06318.77
5.4.390.0170.05018.63
5.4.380.0200.05318.80
5.4.370.0230.05318.76
5.4.360.0130.05718.77
5.4.350.0070.07018.75
5.4.340.0230.04718.59
5.4.320.0170.05718.53
5.4.310.0100.06018.78
5.4.300.0230.04718.84
5.4.290.0130.05718.74
5.4.280.0230.06718.75
5.4.270.0170.05318.61
5.4.260.0230.04318.75
5.4.250.0230.05718.75
5.4.240.0200.06018.78
5.4.230.0270.04318.77
5.4.220.0170.05718.73
5.4.210.0170.06318.57
5.4.200.0230.06316.79
5.4.190.0230.06718.71
5.4.180.0230.05318.61
5.4.170.0200.05018.82
5.4.160.0200.05018.82
5.4.150.0270.04318.73
5.4.140.0170.05316.45
5.4.130.0270.03716.29
5.4.120.0170.05716.30
5.4.110.0270.06016.30
5.4.100.0130.07716.29
5.4.90.0230.06716.29
5.4.80.0230.06716.36
5.4.70.0230.06716.20
5.4.60.0200.06716.28
5.4.50.0170.07316.29
5.4.40.0330.05716.30
5.4.30.0170.05016.18
5.4.20.0130.05316.20
5.4.10.0200.04316.26
5.4.00.0070.05715.71
5.3.290.0100.06014.80
5.3.280.0130.05314.89
5.3.270.0270.04314.61
5.3.260.0270.04714.72
5.3.250.0170.05014.68
5.3.240.0230.04714.81
5.3.230.0170.05314.74
5.3.220.0100.06014.80
5.3.210.0100.06014.86
5.3.200.0230.05014.56
5.3.190.0170.05014.70
5.3.180.0070.05714.57
5.3.170.0200.05014.63
5.3.160.0130.05314.74
5.3.150.0130.05714.75
5.3.140.0200.05714.73
5.3.130.0130.05714.59
5.3.120.0030.06314.72
5.3.110.0230.05014.75
5.3.100.0130.05714.04
5.3.90.0230.04714.07
5.3.80.0230.04014.14
5.3.70.0100.05714.11
5.3.60.0100.05714.29
5.3.50.0130.05314.11
5.3.40.0170.05013.99
5.3.30.0070.05713.97
5.3.20.0130.04713.73
5.3.10.0270.03313.80
5.3.00.0170.05313.93
5.2.170.0100.04311.38
5.2.160.0230.04311.17
5.2.150.0100.04311.26
5.2.140.0170.03711.22
5.2.130.0100.04011.15
5.2.120.0100.04311.18
5.2.110.0130.03711.21
5.2.100.0230.02711.15
5.2.90.0200.03311.16
5.2.80.0130.04311.13
5.2.70.0070.04711.22
5.2.60.0100.04311.04
5.2.50.0100.04311.04
5.2.40.0100.04011.13
5.2.30.0100.04311.08
5.2.20.0170.03311.17
5.2.10.0100.04010.89
5.2.00.0130.03710.75
5.1.60.0070.03710.04
5.1.50.0100.03710.00
5.1.40.0100.03710.02
5.1.30.0070.04010.45
5.1.20.0130.03310.38
5.1.10.0000.04710.16
5.1.00.0130.03310.10
5.0.50.0070.0278.65
5.0.40.0100.0238.61
5.0.30.0100.0408.22
5.0.20.0070.0308.40
5.0.10.0130.0208.36
5.0.00.0100.0408.26
4.4.90.0000.0275.93
4.4.80.0030.0235.91
4.4.70.0070.0205.90
4.4.60.0070.0205.87
4.4.50.0070.0205.96
4.4.40.0070.0335.95
4.4.30.0070.0235.91
4.4.20.0000.0275.93
4.4.10.0070.0205.94
4.4.00.0030.0375.91
4.3.110.0030.0235.88
4.3.100.0070.0205.89
4.3.90.0070.0205.81
4.3.80.0030.0375.89
4.3.70.0030.0235.86
4.3.60.0030.0275.77
4.3.50.0030.0275.80
4.3.40.0070.0335.82
4.3.30.0000.0274.64
4.3.20.0000.0274.55
4.3.10.0030.0234.57
4.3.00.0070.0277.31

preferences:
41.73 ms | 400 KiB | 5 Q