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; $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());

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.0070.01018.56
8.3.50.0120.00618.27
8.3.40.0150.00018.80
8.3.30.0120.00319.39
8.3.20.0080.00020.20
8.3.10.0000.00921.82
8.3.00.0030.00720.93
8.2.180.0150.01016.32
8.2.170.0090.00622.96
8.2.160.0070.00720.57
8.2.150.0000.00824.18
8.2.140.0050.00324.66
8.2.130.0070.00026.16
8.2.120.0090.00019.55
8.2.110.0040.00721.11
8.2.100.0040.00718.16
8.2.90.0030.00519.21
8.2.80.0030.00517.97
8.2.70.0050.00317.71
8.2.60.0030.00618.05
8.2.50.0000.01018.07
8.2.40.0060.00318.32
8.2.30.0080.00018.03
8.2.20.0030.00517.95
8.2.10.0000.00918.21
8.2.00.0080.00017.71
8.1.280.0110.00725.92
8.1.270.0060.00320.64
8.1.260.0040.00426.35
8.1.250.0000.00728.09
8.1.240.0000.00921.48
8.1.230.0130.00017.52
8.1.220.0000.00817.74
8.1.210.0060.00318.77
8.1.200.0070.00317.48
8.1.190.0050.00317.23
8.1.180.0040.00418.10
8.1.170.0040.00420.95
8.1.160.0000.00722.16
8.1.150.0070.00318.84
8.1.140.0070.00017.49
8.1.130.0070.00017.45
8.1.120.0030.00617.49
8.1.110.0040.00417.45
8.1.100.0000.00817.50
8.1.90.0000.00817.42
8.1.80.0040.00417.48
8.1.70.0030.00317.48
8.1.60.0080.00017.61
8.1.50.0030.00617.46
8.1.40.0080.00017.59
8.1.30.0040.00417.69
8.1.20.0040.00417.55
8.1.10.0000.00817.57
8.1.00.0070.00017.52
8.0.300.0050.00218.77
8.0.290.0040.00416.75
8.0.280.0030.00318.52
8.0.270.0000.00717.28
8.0.260.0070.00016.91
8.0.250.0000.00717.00
8.0.240.0050.00316.94
8.0.230.0030.00717.07
8.0.220.0000.00716.98
8.0.210.0000.00716.84
8.0.200.0030.00317.00
8.0.190.0000.00817.09
8.0.180.0040.00416.91
8.0.170.0030.00616.97
8.0.160.0000.00816.98
8.0.150.0030.00316.80
8.0.140.0040.00416.98
8.0.130.0060.00013.38
8.0.120.0060.00316.91
8.0.110.0040.00416.88
8.0.100.0000.00717.02
8.0.90.0000.00716.88
8.0.80.0060.01016.98
8.0.70.0000.00816.78
8.0.60.0000.00717.05
8.0.50.0040.00416.85
8.0.30.0110.01217.05
8.0.20.0140.00617.40
8.0.10.0030.00616.96
8.0.00.0090.00916.77
7.4.330.0050.00015.09
7.4.320.0030.00316.43
7.4.300.0030.00316.46
7.4.290.0030.00616.52
7.4.280.0040.00416.41
7.4.270.0070.00016.60
7.4.260.0060.00316.52
7.4.250.0000.00716.40
7.4.240.0040.00416.54
7.4.230.0080.00016.60
7.4.220.0070.01116.67
7.4.210.0070.01016.73
7.4.200.0070.00016.28
7.4.160.0120.00416.54
7.4.150.0040.01517.40
7.4.140.0090.00817.86
7.4.130.0060.01016.67
7.4.120.0070.01016.58
7.4.110.0160.00316.51
7.4.100.0040.01316.48
7.4.90.0080.00816.59
7.4.80.0060.01219.39
7.4.70.0110.00916.61
7.4.60.0130.00316.61
7.4.50.0000.00816.74
7.4.40.0030.01316.54
7.4.30.0210.00016.41
7.4.00.0070.00714.99
7.3.330.0070.00013.43
7.3.320.0170.00013.32
7.3.310.0030.00316.24
7.3.300.0030.00316.43
7.3.290.0070.00716.39
7.3.280.0100.00816.42
7.3.270.0110.00617.40
7.3.260.0100.00716.36
7.3.250.0040.01316.54
7.3.240.0110.01116.52
7.3.230.0150.00716.41
7.3.210.0070.01016.51
7.3.200.0160.00319.39
7.3.190.0120.00316.39
7.3.180.0130.00916.70
7.3.170.0090.01216.47
7.3.160.0110.00716.42
7.2.330.0070.01016.80
7.2.320.0090.01016.48
7.2.310.0150.00316.86
7.2.300.0060.01616.48
7.2.290.0170.00016.77
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

preferences:
45.98 ms | 400 KiB | 5 Q