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 = null) { 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.40.0060.01018.75
8.3.30.0110.00319.04
8.3.20.0040.00420.13
8.3.10.0040.00421.71
8.3.00.0050.00519.05
8.2.170.0110.00422.96
8.2.160.0070.00720.27
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0070.00026.16
8.2.120.0030.00619.53
8.2.110.0060.00321.04
8.2.100.0080.00418.21
8.2.90.0100.00019.07
8.2.80.0000.00817.97
8.2.70.0060.00317.49
8.2.60.0000.00918.04
8.2.50.0030.00618.07
8.2.40.0070.00318.13
8.2.30.0070.00318.08
8.2.20.0080.00017.68
8.2.10.0000.00818.02
8.2.00.0040.00417.82
8.1.270.0090.00020.57
8.1.260.0000.00726.35
8.1.250.0000.00728.09
8.1.240.0040.00919.54
8.1.230.0060.00617.42
8.1.220.0000.00817.76
8.1.210.0050.00518.77
8.1.200.0100.00017.35
8.1.190.0050.00317.35
8.1.180.0000.00818.10
8.1.170.0050.00320.84
8.1.160.0000.00722.04
8.1.150.0030.00518.91
8.1.140.0080.00017.59
8.1.130.0070.00017.84
8.1.120.0060.00317.53
8.1.110.0000.00717.39
8.1.100.0040.00417.49
8.1.90.0000.00717.48
8.1.80.0040.00417.46
8.1.70.0030.00517.52
8.1.60.0030.00617.65
8.1.50.0040.00417.45
8.1.40.0040.00417.57
8.1.30.0000.00817.66
8.1.20.0040.00417.71
8.1.10.0090.00017.56
8.1.00.0000.00817.51
8.0.300.0040.00418.77
8.0.290.0040.00416.63
8.0.280.0070.00018.36
8.0.270.0080.00017.13
8.0.260.0030.00517.21
8.0.250.0000.00716.85
8.0.240.0070.00016.90
8.0.230.0000.01016.86
8.0.220.0070.00016.86
8.0.210.0030.00516.94
8.0.200.0000.00616.90
8.0.190.0040.00417.01
8.0.180.0030.00616.86
8.0.170.0040.00416.93
8.0.160.0000.00717.00
8.0.150.0000.00716.79
8.0.140.0000.00816.97
8.0.130.0030.00313.36
8.0.120.0030.00516.89
8.0.110.0050.00317.00
8.0.100.0040.00417.04
8.0.90.0050.00316.86
8.0.80.0100.00716.96
8.0.70.0050.00317.01
8.0.60.0040.00416.97
8.0.50.0030.00516.80
8.0.30.0120.01017.04
8.0.20.0110.00817.40
8.0.10.0050.00216.96
8.0.00.0100.01116.94
7.4.330.0050.00015.03
7.4.320.0000.00716.43
7.4.300.0000.00616.62
7.4.290.0060.00316.61
7.4.280.0060.00316.42
7.4.270.0000.00716.53
7.4.260.0030.00316.61
7.4.250.0040.00416.38
7.4.240.0000.00716.57
7.4.230.0040.00416.55
7.4.220.0090.00916.46
7.4.210.0100.01016.64
7.4.200.0080.00016.38
7.4.160.0100.01316.35
7.4.150.0130.00617.40
7.4.140.0110.00917.86
7.4.130.0090.01116.53
7.4.120.0110.00616.66
7.4.110.0150.00616.31
7.4.100.0100.01016.71
7.4.90.0100.00716.44
7.4.80.0090.01619.39
7.4.70.0060.01016.61
7.4.60.0100.00616.64
7.4.50.0080.00016.36
7.4.40.0190.00016.40
7.4.30.0090.00816.51
7.4.00.0060.01214.96
7.3.330.0000.00613.24
7.3.320.0060.00913.24
7.3.310.0040.00416.28
7.3.300.0060.00016.25
7.3.290.0030.01116.40
7.3.280.0080.00716.36
7.3.270.0100.00717.40
7.3.260.0120.00416.42
7.3.250.0120.00616.39
7.3.240.0170.00616.39
7.3.230.0190.00316.54
7.3.210.0110.00716.46
7.3.200.0070.01119.39
7.3.190.0080.00816.44
7.3.180.0120.00916.43
7.3.170.0150.00916.35
7.3.160.0030.01316.56
7.3.120.0120.00614.73
7.3.110.0070.01114.65
7.3.100.0050.00514.78
7.3.90.0130.00314.69
7.3.80.0060.00314.80
7.3.70.0030.00614.96
7.3.60.0070.00714.89
7.3.50.0040.01114.94
7.3.40.0060.00614.75
7.3.30.0040.00814.86
7.3.20.0030.00916.76
7.3.10.0100.00316.70
7.3.00.0110.00316.85
7.2.330.0130.00416.73
7.2.320.0080.01416.57
7.2.310.0100.00716.45
7.2.300.0060.01316.69
7.2.290.0030.01516.60
7.2.250.0100.01015.20
7.2.240.0070.01415.05
7.2.230.0040.00815.02
7.2.220.0080.00414.96
7.2.210.0060.00915.19
7.2.200.0110.00415.17
7.2.190.0070.00714.84
7.2.180.0070.00314.91
7.2.170.0100.00314.99
7.2.60.0080.00316.82
7.2.00.0040.01119.61
7.1.330.0060.01215.92
7.1.320.0080.00415.76
7.1.310.0120.00315.90
7.1.300.0070.01015.88
7.1.290.0030.01015.77
7.1.280.0100.00715.95
7.1.270.0000.01515.84
7.1.260.0030.00815.61
7.1.200.0000.01415.61
7.1.100.0150.01516.42
7.1.70.0000.00917.23
7.1.60.0030.02119.46
7.1.50.0090.01516.98
7.1.00.0100.07022.33
7.0.200.0000.01016.70
7.0.140.0070.04322.01
7.0.60.0070.08019.94
7.0.50.0030.04017.87
7.0.40.0000.05320.09
7.0.30.0270.06020.23
7.0.20.0370.07320.15
7.0.10.0170.07320.05
7.0.00.0100.05320.23
5.6.280.0030.07321.05
5.6.210.0030.08720.47
5.6.200.0070.05318.16
5.6.190.0070.04720.43
5.6.180.0030.06020.68
5.6.170.0270.04020.54
5.6.160.0070.04020.71
5.6.150.0130.06018.29
5.6.140.0030.09018.24
5.6.130.0030.07718.20
5.6.120.0100.04721.04
5.6.110.0070.06321.12
5.6.100.0200.08020.98
5.6.90.0030.04720.99
5.6.80.0100.03320.40
5.5.350.3930.04020.47
5.5.340.0070.05318.08
5.5.330.0130.08320.27
5.5.320.0270.06320.34
5.5.310.0100.05320.27
5.5.300.0070.03717.95
5.5.290.0130.07717.99
5.5.280.0070.05320.77
5.5.270.0100.08020.74
5.5.260.0070.03720.85
5.5.250.0030.04020.67
5.5.240.0230.04720.16
5.4.450.0200.05319.50
5.4.440.0730.06019.57
5.4.430.0070.05719.20
5.4.420.0430.05719.19
5.4.410.0870.05719.04
5.4.400.0200.05318.62
5.4.390.0230.04718.74
5.4.380.0130.05718.63
5.4.370.0070.06318.78
5.4.360.0200.05718.61
5.4.350.0170.05318.63
5.4.340.0100.06018.73
5.4.320.0200.05718.75
5.4.310.0230.04718.58
5.4.300.0170.05318.52
5.4.290.0170.05318.84
5.4.280.0170.05318.72
5.4.270.0230.07018.62
5.4.260.0200.05018.69
5.4.250.0270.05718.74
5.4.240.0230.05018.75
5.4.230.0200.04718.80
5.4.220.0130.06018.77
5.4.210.0270.04318.60
5.4.200.0200.05716.70
5.4.190.0170.05718.69
5.4.180.0100.06018.50
5.4.170.0200.05018.71
5.4.160.0100.05718.57
5.4.150.0130.06018.76
5.4.140.0170.05316.18
5.4.130.0130.06016.34
5.4.120.0200.04316.25
5.4.110.0170.04716.27
5.4.100.0170.05016.30
5.4.90.0230.04716.45
5.4.80.0170.07016.31
5.4.70.0170.05016.15
5.4.60.0230.06016.26
5.4.50.0130.05016.20
5.4.40.0100.05716.27
5.4.30.0200.05016.42
5.4.20.0230.04316.32
5.4.10.0200.04716.42
5.4.00.0100.05315.75
5.3.290.0100.06014.95
5.3.280.0130.05314.71
5.3.270.0230.04714.89
5.3.260.0200.06014.71
5.3.250.0130.05714.79
5.3.240.0170.06714.60
5.3.230.0200.04714.60
5.3.220.0230.05714.87
5.3.210.0170.06014.62
5.3.200.0130.05014.56
5.3.190.0230.06314.62
5.3.180.0270.06014.75
5.3.170.0130.06014.55
5.3.160.0200.04714.61
5.3.150.0230.06314.59
5.3.140.0170.05014.76
5.3.130.0200.06014.58
5.3.120.0200.06714.54
5.3.110.0170.05714.56
5.3.100.0230.06314.32
5.3.90.0130.05714.04
5.3.80.0130.05014.15
5.3.70.0000.06714.22
5.3.60.0200.04314.04
5.3.50.0100.05313.93
5.3.40.0070.05714.23
5.3.30.0130.05013.89
5.3.20.0200.04313.90
5.3.10.0170.04713.70
5.3.00.0170.05013.92
5.2.170.0070.04711.18
5.2.160.0030.04711.13
5.2.150.0170.03711.14
5.2.140.0100.04311.27
5.2.130.0070.04711.16
5.2.120.0170.03311.12
5.2.110.0070.04711.23
5.2.100.0130.04011.21
5.2.90.0130.04011.21
5.2.80.0170.04011.12
5.2.70.0100.04311.30
5.2.60.0130.04011.17
5.2.50.0100.04311.12
5.2.40.0130.03711.12
5.2.30.0100.04310.95
5.2.20.0130.03711.00
5.2.10.0100.04010.95
5.2.00.0130.05310.81
5.1.60.0030.04010.02
5.1.50.0200.03010.18
5.1.40.0170.03010.00
5.1.30.0100.03710.44
5.1.20.0070.04010.45
5.1.10.0070.03710.27
5.1.00.0170.02710.07
5.0.50.0070.0278.73
5.0.40.0070.0278.45
5.0.30.0070.0438.26
5.0.20.0100.0238.28
5.0.10.0070.0278.30
5.0.00.0000.0478.18
4.4.90.0070.0205.92
4.4.80.0100.0175.91
4.4.70.0070.0205.90
4.4.60.0070.0205.90
4.4.50.0100.0205.92
4.4.40.0030.0375.87
4.4.30.0070.0235.91
4.4.20.0030.0275.99
4.4.10.0070.0205.95
4.4.00.0030.0375.91
4.3.110.0000.0275.81
4.3.100.0100.0205.79
4.3.90.0070.0205.82
4.3.80.0030.0375.81
4.3.70.0000.0275.80
4.3.60.0100.0135.84
4.3.50.0070.0275.82
4.3.40.0030.0375.78
4.3.30.0070.0204.55
4.3.20.0070.0204.61
4.3.10.0030.0304.51
4.3.00.0100.0237.31

preferences:
48.22 ms | 400 KiB | 5 Q