3v4l.org

run code in 300+ PHP versions simultaneously
<?php class newsCollection { private $collection; private $keys = [ "headline", "date", "author", ]; public function __construct($data) { foreach ($data as &$el) { $el = array_combine($this->keys, $el); } $this->collection = $data; } public function getNewsCollection() { return $this->collection; } } $sports = [ [ "Boston Red Sox vs New York Yankees - 9-3", "19.06.2017", "ESPN" ], [ "Boston Patriot QB breaks new record!", "16.07.2017", "NESN" ], [ "Celtics coach John Doe inducted into hall of fame", "25.07.2017", "Fox Sports" ], [ "Boston Brewins win 16-5 against New York's Rangers", "21.08.2017", "NESN" ] ]; $c = new newsCollection($sports); var_dump($c->getNewsCollection());

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.4.120.0080.00123.95
8.4.110.0070.00522.28
8.4.100.0140.00717.41
8.4.90.0120.01118.47
8.4.80.0050.00717.97
8.4.70.0030.00517.89
8.4.60.0120.00918.94
8.4.50.0110.00819.29
8.4.40.0170.00317.44
8.4.30.0100.01019.35
8.4.20.0040.01817.73
8.4.10.0140.00317.80
8.3.250.0110.00818.92
8.3.240.0060.00616.94
8.3.230.0110.00416.66
8.3.220.0110.00817.18
8.3.210.0060.00216.69
8.3.200.0040.00416.61
8.3.190.0110.00817.09
8.3.180.0040.00416.83
8.3.170.0120.00619.27
8.3.160.0030.01418.72
8.3.150.0130.00720.80
8.3.140.0040.01118.56
8.3.130.0050.00316.57
8.3.120.0060.00318.82
8.3.110.0000.00820.94
8.3.100.0100.00624.06
8.3.90.0080.00026.77
8.3.80.0000.01116.63
8.3.70.0060.01316.63
8.3.60.0070.00716.73
8.3.50.0130.00516.67
8.3.40.0100.01018.78
8.3.30.0110.00418.73
8.3.20.0020.00520.21
8.3.10.0050.00320.96
8.3.00.0040.00420.96
8.2.290.0070.01120.50
8.2.280.0130.00918.18
8.2.270.0100.01017.05
8.2.260.0140.00320.97
8.2.250.0030.00516.47
8.2.240.0150.00017.32
8.2.230.0090.00322.58
8.2.220.0040.00437.54
8.2.210.0140.00426.77
8.2.200.0060.00316.38
8.2.190.0070.01518.41
8.2.180.0130.01016.38
8.2.170.0140.00422.96
8.2.160.0040.01121.95
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0050.00326.16
8.2.120.0040.00420.86
8.2.110.0100.00022.26
8.2.100.0060.00617.91
8.2.90.0030.00717.64
8.2.80.0030.00518.80
8.2.70.0000.00817.50
8.2.60.0050.00317.50
8.2.50.0080.00017.63
8.2.40.0000.00820.42
8.2.30.0070.00019.16
8.2.20.0040.00417.94
8.2.10.0040.00418.05
8.2.00.0030.00518.12
8.1.330.0130.00722.07
8.1.320.0090.01016.18
8.1.310.0080.00016.76
8.1.300.0160.00317.79
8.1.290.0000.01218.88
8.1.280.0060.00925.92
8.1.270.0000.00822.09
8.1.260.0060.00326.35
8.1.250.0040.00428.09
8.1.240.0000.00923.92
8.1.230.0080.00321.03
8.1.220.0040.00417.78
8.1.210.0040.00418.77
8.1.200.0000.00817.35
8.1.190.0050.00317.23
8.1.180.0040.00418.10
8.1.170.0040.00418.50
8.1.160.0000.00718.85
8.1.150.0040.00420.20
8.1.140.0060.00619.49
8.1.130.0070.00019.28
8.1.120.0050.00317.45
8.1.110.0000.00817.36
8.1.100.0080.00017.45
8.1.90.0040.00417.46
8.1.80.0030.00517.52
8.1.70.0000.00717.45
8.1.60.0000.00817.54
8.1.50.0030.00517.45
8.1.40.0000.00917.31
8.1.30.0040.00417.76
8.1.20.0050.00317.66
8.1.10.0040.00417.50
8.1.00.0040.00417.37
8.0.300.0050.00321.47
8.0.290.0000.00916.63
8.0.280.0000.00718.43
8.0.270.0000.00717.26
8.0.260.0000.00716.93
8.0.250.0070.00016.83
8.0.240.0040.00416.86
8.0.230.0040.00416.87
8.0.220.0030.00516.95
8.0.210.0070.00016.91
8.0.200.0070.00016.92
8.0.190.0040.00416.86
8.0.180.0030.00516.82
8.0.170.0050.00216.95
8.0.160.0000.00817.02
8.0.150.0070.00016.93
8.0.140.0050.00216.75
8.0.130.0000.00713.38
8.0.120.0050.00316.90
8.0.110.0040.00416.81
8.0.100.0000.00816.78
8.0.90.0040.00416.77
8.0.80.0080.00816.82
8.0.70.0000.00816.79
8.0.60.0020.00516.79
8.0.50.0000.00716.72
8.0.30.0110.01017.11
8.0.20.0130.00617.40
8.0.10.0000.00716.97
8.0.00.0060.01216.73
7.4.330.0050.00015.55
7.4.320.0000.00616.58
7.4.300.0030.00316.59
7.4.290.0020.00516.61
7.4.280.0040.00416.61
7.4.270.0030.00316.49
7.4.260.0030.00316.63
7.4.250.0000.00716.43
7.4.240.0000.00716.46
7.4.230.0030.00316.61
7.4.220.0000.00716.54
7.4.210.0080.01016.64
7.4.200.0030.00316.51
7.4.160.0070.01216.60
7.4.150.0090.00917.40
7.4.140.0120.00917.86
7.4.130.0120.00916.54
7.4.120.0120.00716.51
7.4.110.0060.01216.58
7.4.100.0090.00916.61
7.4.90.0060.01216.38
7.4.80.0100.00819.39
7.4.70.0060.01116.53
7.4.60.0110.00616.42
7.4.50.0070.00716.54
7.4.40.0070.01016.33
7.4.30.0030.01416.44
7.4.00.0070.01015.09
7.3.330.0050.00013.16
7.3.320.0060.00013.25
7.3.310.0000.00716.33
7.3.300.0070.00016.10
7.3.290.0060.00316.14
7.3.280.0070.01116.30
7.3.270.0090.00817.40
7.3.260.0190.00616.37
7.3.250.0110.00916.53
7.3.240.0130.00616.57
7.3.230.0170.00416.58
7.3.210.0110.00816.45
7.3.200.0090.00816.30
7.3.190.0160.00716.28
7.3.180.0090.01016.30
7.3.170.0130.01016.63
7.3.160.0060.01516.30
7.2.330.0100.00616.80
7.2.320.0150.00316.51
7.2.310.0130.00916.85
7.2.300.0000.01716.87
7.2.290.0070.01016.58
7.2.60.0100.00316.97
7.1.200.0040.00415.79
7.1.90.1740.01016.22
7.1.80.0040.00918.09
7.1.70.0060.00917.03
7.1.60.0200.00734.98
7.1.50.0140.01434.50
7.1.40.0220.01534.14
7.1.30.0100.01734.45
7.1.20.0210.01034.41
7.1.10.0040.01216.77
7.1.00.0040.01416.75
7.0.230.1650.01618.04
7.0.220.0030.01017.83
7.0.210.1780.01616.37
7.0.200.0030.01016.78
7.0.190.0090.00316.67
7.0.180.1120.00714.67
7.0.170.0070.00716.20
7.0.160.0060.01116.33
7.0.150.0030.01316.17
7.0.140.0090.00916.40
7.0.130.1090.01416.50
7.0.120.0040.00816.70
7.0.110.0040.00916.20
7.0.100.0060.00616.42
7.0.90.0050.00816.45
7.0.80.0060.00616.34
7.0.70.0040.01216.16
7.0.60.0890.00016.12
7.0.50.0960.01014.69
7.0.40.0040.00816.60
7.0.30.0770.00614.69
7.0.20.0030.01016.13
7.0.10.0030.00916.38
7.0.00.0890.00716.29

preferences:
32.92 ms | 403 KiB | 5 Q