3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Gridizer { /** * Get a squar-ish grid */ public function getGrid($array) { $grid_size = floor(sqrt(count($array))); $table = $this->chunk($table_cells, max($grid_size, 1)); foreach ($table as $row) { echo implode(' | ', $row) . PHP_EOL; } } /** * Create a Generator to chunk an incoming array into `$chunk_size` sized chunks */ public function chunk(array $array, $chunk_size) { $index = 0; while ($index < count($array)) { yield array_slice($array, $index, $chunk_size, true); $index += $chunk_size; } } } $foo = new Gridizer; echo $foo->getGrid(range(1, 100));

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.0160.00018.39
8.3.50.0120.00916.34
8.3.40.0110.00418.76
8.3.30.0070.00718.80
8.3.20.0040.00420.33
8.3.10.0080.00021.85
8.3.00.0070.00318.16
8.2.180.0060.01016.75
8.2.170.0090.00622.96
8.2.160.0040.01120.35
8.2.150.0000.00824.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0080.00017.63
8.2.110.0040.00820.70
8.2.100.0070.00418.03
8.2.90.0030.00519.13
8.2.80.0090.00017.97
8.2.70.0080.00017.63
8.2.60.0090.00017.93
8.2.50.0040.00818.07
8.2.40.0040.00419.45
8.2.30.0000.00920.75
8.2.20.0050.00317.80
8.2.10.0040.00418.13
8.2.00.0070.00018.00
8.1.280.0060.00925.92
8.1.270.0080.00323.83
8.1.260.0040.00426.35
8.1.250.0030.00528.09
8.1.240.0040.00422.58
8.1.230.0080.00817.42
8.1.220.0000.00817.74
8.1.210.0000.00818.77
8.1.200.0070.00317.25
8.1.190.0060.00317.23
8.1.180.0030.00518.10
8.1.170.0030.00618.70
8.1.160.0040.00422.02
8.1.150.0030.00518.87
8.1.140.0000.00817.53
8.1.130.0000.00817.70
8.1.120.0050.00217.54
8.1.110.0060.00317.48
8.1.100.0080.00017.56
8.1.90.0050.00217.43
8.1.80.0040.00417.39
8.1.70.0040.00417.58
8.1.60.0000.00817.63
8.1.50.0030.00617.63
8.1.40.0000.00717.52
8.1.30.0000.00917.66
8.1.20.0050.00317.72
8.1.10.0030.00517.59
8.1.00.0040.00417.47
8.0.300.0030.00618.77
8.0.290.0040.00416.75
8.0.280.0030.00318.45
8.0.270.0030.00316.82
8.0.260.0060.00017.28
8.0.250.0040.00417.05
8.0.240.0030.00616.91
8.0.230.0030.00317.04
8.0.220.0000.00816.94
8.0.210.0000.00716.84
8.0.200.0000.00717.04
8.0.190.0000.00716.95
8.0.180.0000.00816.86
8.0.170.0030.00516.96
8.0.160.0000.00717.07
8.0.150.0040.00417.00
8.0.140.0050.00216.89
8.0.130.0030.00313.47
8.0.120.0030.00516.94
8.0.110.0000.00716.99
8.0.100.0030.00617.00
8.0.90.0000.00716.91
8.0.80.0060.00916.98
8.0.70.0000.00717.11
8.0.60.0000.00816.89
8.0.50.0040.00417.04
8.0.30.0120.00517.18
8.0.20.0080.01217.40
8.0.10.0040.00417.14
8.0.00.0110.00816.89
7.4.330.0050.00015.14
7.4.320.0000.00816.69
7.4.300.0070.00016.60
7.4.290.0040.00416.68
7.4.280.0040.00416.63
7.4.270.0040.00416.63
7.4.260.0030.00316.48
7.4.250.0000.00816.50
7.4.240.0040.00316.71
7.4.230.0040.00416.67
7.4.220.0090.00916.79
7.4.210.0140.00716.63
7.4.200.0030.00316.48
7.4.160.0060.00916.42
7.4.150.0150.00317.40
7.4.140.0100.00817.86
7.4.130.0160.00116.65
7.4.120.0170.00616.53
7.4.110.0120.01216.65
7.4.100.0100.00716.66
7.4.90.0090.01316.68
7.4.80.0100.01419.39
7.4.70.0030.01916.63
7.4.60.0070.01016.62
7.4.50.0060.00316.59
7.4.40.0040.01316.64
7.4.30.0110.00616.47
7.4.00.0130.00314.83
7.3.330.0000.00513.49
7.3.320.0050.00013.38
7.3.310.0000.00716.26
7.3.300.0040.00416.32
7.3.290.0050.01316.42
7.3.280.0110.00816.42
7.3.270.0170.00017.40
7.3.260.0060.01216.40
7.3.250.0100.00716.39
7.3.240.0120.00616.44
7.3.230.0180.00616.65
7.3.210.0170.00016.48
7.3.200.0070.01016.40
7.3.190.0080.00816.40
7.3.180.0070.01416.50
7.3.170.0180.00316.38
7.3.160.0130.00716.49
7.2.330.0080.00916.58
7.2.320.0100.00716.65
7.2.310.0070.01116.43
7.2.300.0110.00516.70
7.2.290.0070.01016.77
7.2.60.0070.00716.26
7.2.00.0000.01119.28
7.1.200.0070.00615.61
7.1.100.0000.01417.95
7.1.70.0060.00317.20
7.1.60.0100.01619.29
7.1.50.0170.02034.55
7.1.00.0100.07022.28
7.0.200.0000.00716.80
7.0.60.0100.06319.95
7.0.50.0030.08317.74
7.0.40.0000.08320.10
7.0.30.0300.08020.23
7.0.20.0270.07020.19
7.0.10.0230.05720.07
7.0.00.0070.06720.30
5.6.210.0130.07720.54
5.6.200.0030.06018.25
5.6.190.0070.05720.67
5.6.180.0270.05320.61
5.6.170.0230.05720.62
5.6.160.0170.04020.71
5.6.150.0070.05018.18
5.6.140.0000.04718.24
5.6.130.0030.04318.13
5.6.120.0070.05720.90
5.6.110.0070.08321.02
5.6.100.0070.08321.00
5.6.90.0070.08720.98
5.6.80.0130.07320.41
5.5.350.0200.08320.42
5.5.340.0070.08017.99
5.5.330.0100.08320.27
5.5.320.0270.04320.28
5.5.310.0330.05020.30
5.5.300.0070.06017.93
5.5.290.0100.06317.95
5.5.280.0070.04020.96
5.5.270.0070.04020.88
5.5.260.0030.04320.89
5.5.250.0130.07720.70
5.5.240.0100.06020.03
5.4.450.0770.05719.17
5.4.440.0630.06019.45
5.4.430.0970.04719.61
5.4.420.0730.06719.53
5.4.410.0630.06019.21
5.4.400.0730.05019.02
5.4.390.0630.05719.26
5.4.380.0730.06319.38
5.4.370.0800.05018.97
5.4.360.0970.05019.14
5.4.350.0730.04719.26
5.4.340.0630.05719.26
5.4.320.0630.05719.29
5.4.310.0630.05719.28
5.4.300.0700.06719.14
5.4.290.0730.05719.28
5.4.280.0700.05718.87
5.4.270.0830.05319.06
5.4.260.0930.04019.14
5.4.250.0830.07019.28
5.4.240.0930.06719.36
5.4.230.0800.07719.14
5.4.220.0670.05719.25
5.4.210.0670.05019.22
5.4.200.0630.05319.30
5.4.190.0700.05319.07
5.4.180.0830.05019.05
5.4.170.0630.05719.36
5.4.160.0730.04719.29
5.4.150.0700.05319.23
5.4.140.0800.05716.52
5.4.130.0670.06016.46
5.4.120.0600.05316.51
5.4.110.0700.04716.52
5.4.100.0770.04316.42
5.4.90.0730.06016.45
5.4.80.0900.06016.58
5.4.70.0070.05716.52
5.4.60.0200.07016.48
5.4.50.0230.03716.51
5.4.40.0400.04316.44
5.4.30.0000.03316.23
5.4.20.0070.05016.52
5.4.10.0400.03716.50

preferences:
60.46 ms | 401 KiB | 5 Q