3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ReportController { protected $source; protected $data; public function __construct(array $source, $dataObject = null, \Closure $transformer = null) { $this->source = $source; $this->data = ($dataObject) ? [] : $dataObject; $this->transform($transformer); } public function transform(\Closure $transformer) { array_walk($this->source, $transformer); } public function getData() { return $this->data; } } $source = [ ['type'=>'open'], ['type'=>'closed'], ['type'=>'pending'], ['type'=>'accepted'] ]; $transformer = function($ticket, $key) { (isset($this->data[$ticket['type']]))? $this->data[$ticket['type']]++: $this->data[$ticket['type']]=1; }; $report = new ReportController($source); 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.0120.00616.88
8.3.50.0070.01122.03
8.3.40.0120.00419.00
8.3.30.0140.00718.87
8.3.20.0070.00020.24
8.3.10.0040.00421.90
8.3.00.0100.00019.18
8.2.180.0140.00718.29
8.2.170.0110.00422.96
8.2.160.0130.00720.44
8.2.150.0030.00624.18
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0000.00819.20
8.2.110.0070.00322.20
8.2.100.0070.00717.91
8.2.90.0040.00419.10
8.2.80.0080.00017.97
8.2.70.0090.00017.61
8.2.60.0000.00818.04
8.2.50.0030.00618.07
8.2.40.0060.00318.06
8.2.30.0000.00818.13
8.2.20.0040.00417.67
8.2.10.0060.00318.05
8.2.00.0040.00417.88
8.1.280.0060.01325.92
8.1.270.0030.00620.61
8.1.260.0080.00026.35
8.1.250.0000.00728.09
8.1.240.0030.00720.83
8.1.230.0090.00320.80
8.1.220.0000.00818.74
8.1.210.0050.00318.77
8.1.200.0060.00317.25
8.1.190.0040.00417.23
8.1.180.0000.00718.10
8.1.170.0030.00520.22
8.1.160.0080.00021.95
8.1.150.0080.00018.89
8.1.140.0030.00617.52
8.1.130.0000.00817.76
8.1.120.0030.00617.42
8.1.110.0040.00417.54
8.1.100.0040.00417.48
8.1.90.0030.00317.50
8.1.80.0080.00017.45
8.1.70.0040.00417.41
8.1.60.0000.00817.50
8.1.50.0040.00417.60
8.1.40.0040.00417.59
8.1.30.0030.00617.64
8.1.20.0040.00417.61
8.1.10.0040.00417.60
8.1.00.0030.00517.50
8.0.300.0000.00718.77
8.0.290.0070.00016.75
8.0.280.0070.00018.45
8.0.270.0000.00717.09
8.0.260.0030.00517.28
8.0.250.0030.00317.00
8.0.240.0070.00017.04
8.0.230.0000.00916.98
8.0.220.0040.00416.92
8.0.210.0000.00716.95
8.0.200.0000.00617.08
8.0.190.0030.00617.01
8.0.180.0050.00516.91
8.0.170.0000.00716.97
8.0.160.0020.00517.03
8.0.150.0040.00316.98
8.0.140.0030.00516.90
8.0.130.0000.00613.39
8.0.120.0000.00816.90
8.0.110.0000.00716.94
8.0.100.0040.00417.00
8.0.90.0000.00716.82
8.0.80.0110.00417.00
8.0.70.0040.00417.00
8.0.60.0030.00516.80
8.0.50.0050.00317.00
8.0.30.0180.00616.85
8.0.20.0090.00917.40
8.0.10.0040.00416.96
8.0.00.0130.00816.75
7.4.330.0060.00015.03
7.4.320.0000.00716.67
7.4.300.0050.00216.43
7.4.290.0090.00016.41
7.4.280.0000.00716.63
7.4.270.0040.00416.55
7.4.260.0080.00316.65
7.4.250.0000.00716.61
7.4.240.0020.00516.56
7.4.230.0000.00716.33
7.4.220.0070.01116.60
7.4.210.0040.01716.60
7.4.200.0030.00316.70
7.4.160.0070.01716.54
7.4.150.0090.00917.40
7.4.140.0160.00517.86
7.4.130.0080.01216.68
7.4.120.0110.00916.56
7.4.110.0150.00416.55
7.4.100.0110.01116.61
7.4.90.0110.00716.62
7.4.80.0150.00619.39
7.4.70.0140.00416.36
7.4.60.0090.00616.73
7.4.50.0080.00016.34
7.4.40.0070.01316.48
7.4.30.0150.00316.60
7.4.10.0040.00915.29
7.4.00.0050.01215.01
7.3.330.0030.00313.34
7.3.320.0000.01513.17
7.3.310.0040.00416.41
7.3.300.0030.00316.34
7.3.290.0040.01116.38
7.3.280.0090.00716.39
7.3.270.0170.02417.40
7.3.260.0060.01116.61
7.3.250.0100.01016.46
7.3.240.0190.00616.57
7.3.230.0060.01816.42
7.3.210.0100.00716.51
7.3.200.0120.00819.39
7.3.190.0060.01016.52
7.3.180.0130.01016.43
7.3.170.0120.01016.48
7.3.160.0120.01216.48
7.3.130.0070.01015.05
7.3.120.0060.01314.98
7.3.110.0030.01214.66
7.3.100.0060.00614.88
7.3.90.0090.00614.93
7.3.80.0040.01114.75
7.3.70.0060.00915.00
7.3.60.0000.01014.69
7.3.50.0070.00414.74
7.3.40.0120.00014.89
7.3.30.0060.00614.84
7.3.20.0110.00316.84
7.3.10.0040.01416.71
7.3.00.0080.00816.70
7.2.330.0060.01216.33
7.2.320.0150.00316.65
7.2.310.0090.00916.71
7.2.300.0120.00916.67
7.2.290.0100.01316.54
7.2.260.0070.00714.92
7.2.250.0100.00715.01
7.2.240.0030.01014.97
7.2.230.0060.01014.68
7.2.220.0050.00514.94
7.2.210.0110.00414.80
7.2.200.0080.00414.82
7.2.190.0090.00915.04
7.2.180.0070.00314.99
7.2.170.0030.00615.02
7.2.160.0050.00514.93
7.2.150.0110.00316.91
7.2.140.0050.00516.97
7.2.130.0000.01416.88
7.2.120.0070.00416.68
7.2.110.0100.00716.84
7.2.100.0060.00316.92
7.2.90.0040.01116.93
7.2.80.0060.00316.92
7.2.70.0090.00016.92
7.2.60.0100.00116.79
7.2.50.0090.00616.68
7.2.40.0080.00816.64
7.2.30.0030.01017.04
7.2.20.0060.00916.69
7.2.10.0070.00716.84
7.2.00.0060.00616.64
7.1.330.0030.01015.78
7.1.320.0060.00615.98
7.1.310.0030.01015.87
7.1.300.0060.00315.87
7.1.290.0050.00515.55
7.1.280.0000.01015.80
7.1.270.0060.00915.92
7.1.260.0030.00715.80
7.1.250.0090.00616.04
7.1.240.0090.00615.79
7.1.230.0030.00615.83
7.1.220.0030.01015.90
7.1.210.0030.01015.94
7.1.200.0050.00515.66
7.1.190.0040.01115.75
7.1.180.0000.01115.77
7.1.170.0120.00315.69
7.1.160.0040.01115.85
7.1.150.0040.00715.75
7.1.140.0070.01015.73
7.1.130.0090.00315.94
7.1.120.0030.00615.87
7.1.110.0030.01015.83
7.1.100.0030.00715.67
7.1.90.0040.00415.99
7.1.80.0070.00415.70
7.1.70.0040.00616.46
7.1.60.0030.01617.62
7.1.50.0090.00716.29
7.1.40.0090.00315.91
7.1.30.0000.01215.70
7.1.20.0000.01215.55
7.1.10.0060.00315.72
7.1.00.0030.04218.99
7.0.330.0100.00315.42
7.0.320.0120.00315.19
7.0.310.0040.01115.38
7.0.300.0090.00615.52
7.0.290.0040.00815.52
7.0.280.0030.01215.45
7.0.270.0040.00815.41
7.0.260.0040.00715.52
7.0.250.0000.00815.43
7.0.240.0000.01615.48
7.0.230.0050.00515.49
7.0.220.0030.01015.29
7.0.210.0050.01015.32
7.0.200.0030.00815.98
7.0.190.0050.00715.54
7.0.180.0000.01015.53
7.0.170.0040.01115.51
7.0.160.0040.00715.26
7.0.150.0060.00915.59
7.0.140.0070.03118.81
7.0.130.0070.00715.35
7.0.120.0030.00615.52
7.0.110.0060.00615.55
7.0.100.0000.01215.55
7.0.90.0000.00915.47
7.0.80.0070.00715.50
7.0.70.2180.02317.64
7.0.60.0050.04917.56
7.0.50.0050.02516.69
7.0.40.0000.03016.97
7.0.30.0150.04316.82
7.0.20.0180.03816.94
7.0.10.0150.04416.70
7.0.00.0090.04816.93
5.6.400.0130.00014.20
5.6.390.0040.00414.51
5.6.380.0110.00314.71
5.6.370.0140.00314.47
5.6.360.0030.01114.26
5.6.350.0030.01014.51
5.6.340.0030.01313.93
5.6.330.0000.01314.17
5.6.320.0070.00714.36
5.6.310.0000.01614.19
5.6.300.0100.00314.67
5.6.290.0030.00914.33
5.6.280.0020.04417.69
5.6.270.0070.00414.31
5.6.260.0130.00314.32
5.6.250.0060.00614.09
5.6.240.0060.01214.31
5.6.230.0060.00314.18
5.6.220.0070.01014.19
5.6.210.0070.02017.49
5.6.200.0060.02316.16
5.6.190.0080.02317.39
5.6.180.0100.03117.40
5.6.170.0150.03217.32
5.6.160.0120.02517.39
5.6.150.0060.04416.29
5.6.140.0100.03216.23
5.6.130.0020.02516.13
5.6.120.0100.03417.69
5.6.110.0050.03617.73
5.6.100.0070.04417.79
5.6.90.0050.05017.77
5.6.80.0110.04017.44
5.6.70.0140.02217.26
5.6.60.0100.00314.36
5.6.50.0000.00814.22
5.6.40.0050.00514.51
5.6.30.0070.00714.30
5.6.20.0030.01314.03
5.6.10.0080.00814.19
5.6.00.0040.01114.18
5.5.380.0070.00414.26
5.5.370.0040.00714.12
5.5.360.0000.01414.11
5.5.350.0020.05317.39
5.5.340.0050.02516.15
5.5.330.0100.02517.20
5.5.320.0020.03417.31
5.5.310.0150.04717.22
5.5.300.0100.02016.25
5.5.290.0130.03516.07
5.5.280.0050.02417.69
5.5.270.0030.02517.50
5.5.260.0080.04517.45
5.5.250.0100.03917.44
5.5.240.0120.02617.28
5.5.230.0150.00414.22
5.5.220.0000.01814.05
5.5.210.0060.01314.25
5.5.200.0060.01214.37
5.5.190.0140.00714.35
5.5.180.0090.00913.84
5.5.170.0100.01014.02
5.5.160.0110.00814.24
5.5.150.0120.00313.89
5.5.140.0000.02013.99
5.5.130.0080.01214.25
5.5.120.0090.00614.51
5.5.110.0040.01414.00
5.5.100.0060.00614.27
5.5.90.0090.00614.52
5.5.80.0000.01414.02
5.5.70.0030.01014.08
5.5.60.0040.00814.20
5.5.50.0030.00814.28
5.5.40.0110.00314.39
5.5.30.0000.01114.19
5.5.20.0030.00614.34
5.5.10.0070.00313.87
5.5.00.0080.00414.01
5.4.450.0050.03515.13
5.4.440.0450.03315.32
5.4.430.0370.03215.18
5.4.420.0530.02515.35
5.4.410.0050.03915.31
5.4.400.0120.03015.00
5.4.390.0120.03014.99
5.4.380.0110.03314.86
5.4.370.0100.03414.84
5.4.360.0170.02314.94
5.4.350.0140.02714.94
5.4.340.0120.03714.80
5.4.330.0000.00811.12
5.4.320.0120.04314.89
5.4.310.0070.03514.90
5.4.300.0060.03514.85
5.4.290.0200.03314.75
5.4.280.0100.03114.92
5.4.270.0130.03014.82
5.4.260.0100.03114.72
5.4.250.0130.02814.85
5.4.240.0100.03514.97
5.4.230.0170.03114.76
5.4.220.0130.02714.85
5.4.210.0130.03014.60
5.4.200.0100.02813.89
5.4.190.0120.03014.74
5.4.180.0090.03014.73
5.4.170.0120.03114.71
5.4.160.0100.03014.87
5.4.150.0150.02514.66
5.4.140.0170.02313.69
5.4.130.0120.02913.69
5.4.120.0090.03013.41
5.4.110.0140.02613.67
5.4.100.0170.02413.50
5.4.90.0120.03013.65
5.4.80.0120.02613.70
5.4.70.0150.03513.74
5.4.60.0150.02713.60
5.4.50.0090.03113.67
5.4.40.0150.03513.52
5.4.30.0050.03313.70
5.4.20.0120.05213.70
5.4.10.0110.03613.51
5.4.00.0150.03313.21
5.3.290.0070.06714.77
5.3.280.0270.04314.70
5.3.270.0130.05714.61
5.3.260.0200.05314.81
5.3.250.0270.04314.60
5.3.240.0170.06014.70
5.3.230.0400.03314.78
5.3.220.0070.06314.67
5.3.210.0170.07314.61
5.3.200.0130.07314.70
5.3.190.0100.06714.56
5.3.180.0200.06014.75
5.3.170.0100.08014.73
5.3.160.0070.06314.54
5.3.150.0230.05314.85
5.3.140.0200.05014.73
5.3.130.0130.05714.83
5.3.120.0170.05714.67
5.3.110.0170.05714.66
5.3.100.0130.05714.08
5.3.90.0200.05014.21
5.3.80.0300.06014.14
5.3.70.0130.05714.03
5.3.60.0200.05314.12
5.3.50.0130.05314.04
5.3.40.0200.06014.08
5.3.30.0100.05314.05
5.3.20.0130.05313.74
5.3.10.0230.06013.78
5.3.00.0200.06713.68
5.2.170.0070.05011.23
5.2.160.0170.04311.37
5.2.150.0070.04711.22
5.2.140.0200.03711.27
5.2.130.0030.05011.23
5.2.120.0100.04011.31
5.2.110.0170.03711.21
5.2.100.0130.04311.16
5.2.90.0170.05311.16
5.2.80.0230.03011.13
5.2.70.0100.04311.20
5.2.60.0200.03311.03
5.2.50.0070.05011.03
5.2.40.0100.04310.97
5.2.30.0130.04711.07
5.2.20.0100.04010.96
5.2.10.0030.04710.97
5.2.00.0070.04710.75
5.1.60.0100.03310.13
5.1.50.0100.03710.12
5.1.40.0130.04710.17
5.1.30.0070.05310.44
5.1.20.0100.03710.34
5.1.10.0130.03710.17
5.1.00.0100.03710.19
5.0.50.0070.0338.64
5.0.40.0070.0308.54
5.0.30.0130.0378.35
5.0.20.0070.0308.34
5.0.10.0070.0308.21
5.0.00.0130.0378.31
4.4.90.0100.0176.02
4.4.80.0130.0175.93
4.4.70.0100.0205.88
4.4.60.0000.0275.98
4.4.50.0070.0205.90
4.4.40.0070.0375.90
4.4.30.0130.0175.90
4.4.20.0030.0235.99
4.4.10.0030.0236.02
4.4.00.0100.0305.91
4.3.110.0000.0275.95
4.3.100.0100.0175.94
4.3.90.0030.0235.82
4.3.80.0100.0305.87
4.3.70.0070.0205.81
4.3.60.0030.0235.81
4.3.50.0100.0175.77
4.3.40.0030.0375.88
4.3.30.0030.0274.61
4.3.20.0000.0274.57
4.3.10.0030.0234.49
4.3.00.0030.0237.31

preferences:
38.12 ms | 401 KiB | 5 Q