3v4l.org

run code in 300+ PHP versions simultaneously
<?php function terminal_table($col1, $col2, $max_num_spaces_between_columns) { $num_spaces = $max_num_spaces_between_columns - mb_strlen($col1); if ($num_spaces <= 0) $num_spaces = 1; // Always at least 1 space. return $col1 . str_repeat(' ', $num_spaces) . $col2; } echo terminal_table('Cats', '1', 32) . "\n"; echo terminal_table('Dogs', '2', 32) . "\n"; echo terminal_table('Rabbits', '999', 32) . "\n"; echo terminal_table('Horses', '16', 32) . "\n"; echo terminal_table('Cows', '64', 32) . "\n"; echo terminal_table('Mice', '5', 32) . "\n"; echo terminal_table('Pigs', '16', 32) . "\n"; function tabify($col1, $col2, $numTabs) { $tabs = ''; for ($x = 0; $x < $numTabs; $x ++) { $tabs .= "\t"; } return $col1 . $tabs . $col2; } echo tabify('Cats', '1', 3) . "\n"; echo tabify('Dogs', '2', 3) . "\n"; echo tabify('Rabbits', '999', 3) . "\n"; echo tabify('Horses', '16', 3) . "\n"; echo tabify('Cows', '64', 3) . "\n"; echo tabify('Mice', '5', 3) . "\n"; echo tabify('Pigs', '16', 3) . "\n";

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.0090.00618.18
8.3.50.0110.00618.32
8.3.40.0120.00318.53
8.3.30.0140.00018.86
8.3.20.0050.00320.86
8.3.10.0040.00423.65
8.3.00.0030.00622.51
8.2.180.0110.01116.75
8.2.170.0070.01118.82
8.2.160.0100.01022.96
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0070.00019.39
8.2.110.0000.01019.27
8.2.100.0040.00717.72
8.2.90.0030.00519.15
8.2.80.0000.00817.97
8.2.70.0000.00817.75
8.2.60.0090.00018.05
8.2.50.0030.00518.07
8.2.40.0080.00018.29
8.2.30.0070.00018.02
8.2.20.0000.00718.06
8.2.10.0000.00819.27
8.2.00.0000.00718.11
8.1.280.0090.00625.92
8.1.270.0040.00422.03
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0000.01222.07
8.1.230.0080.00420.88
8.1.220.0040.00417.74
8.1.210.0080.00018.77
8.1.200.0060.00317.35
8.1.190.0080.00017.10
8.1.180.0040.00418.10
8.1.170.0000.00918.48
8.1.160.0080.00018.82
8.1.150.0050.00318.78
8.1.140.0000.00719.09
8.1.130.0030.00317.39
8.1.120.0050.00317.32
8.1.110.0000.00717.36
8.1.100.0040.00417.49
8.1.90.0030.00517.47
8.1.80.0040.00417.32
8.1.70.0040.00417.53
8.1.60.0040.00417.57
8.1.50.0040.00417.64
8.1.40.0060.00317.43
8.1.30.0060.00317.76
8.1.20.0030.00617.67
8.1.10.0030.00617.61
8.1.00.0050.00317.38
8.0.300.0070.00018.77
8.0.290.0000.00916.73
8.0.280.0070.00018.52
8.0.270.0040.00416.91
8.0.260.0050.00316.91
8.0.250.0070.00017.02
8.0.240.0090.00016.95
8.0.230.0000.00717.00
8.0.220.0040.00416.99
8.0.210.0000.00716.89
8.0.200.0040.00417.02
8.0.190.0000.00716.95
8.0.180.0040.00416.89
8.0.170.0030.00517.01
8.0.160.0040.00716.88
8.0.150.0000.00717.00
8.0.140.0050.00216.96
8.0.130.0030.00313.39
8.0.120.0050.00316.99
8.0.110.0070.00016.93
8.0.100.0000.00717.00
8.0.90.0050.00316.98
8.0.80.0000.01516.90
8.0.70.0050.00216.83
8.0.60.0040.00416.80
8.0.50.0040.00416.93
8.0.30.0100.00817.02
8.0.20.0140.00617.03
8.0.10.0060.00316.83
8.0.00.0080.01016.70
7.4.330.0000.00515.55
7.4.320.0030.00316.67
7.4.300.0000.00716.45
7.4.290.0000.00716.62
7.4.280.0030.00516.52
7.4.270.0030.00516.67
7.4.260.0070.00016.47
7.4.250.0030.00316.39
7.4.240.0030.00316.44
7.4.230.0000.00716.71
7.4.220.0030.00316.37
7.4.210.0120.00716.60
7.4.200.0080.00016.50
7.4.140.0150.00917.86
7.4.130.0070.01716.43
7.4.120.0000.02016.49
7.4.110.0060.01216.46
7.4.100.0140.00616.71
7.4.90.0040.01216.49
7.4.80.0120.00619.39
7.4.70.0130.01016.59
7.4.60.0140.00316.55
7.4.50.0070.01016.61
7.4.40.0190.00316.61
7.4.00.0080.00914.91
7.3.330.0050.00013.29
7.3.320.0000.00613.40
7.3.310.0030.00316.18
7.3.300.0040.00416.20
7.3.290.0060.00916.31
7.3.280.0080.00916.26
7.3.260.0100.00816.52
7.3.230.0090.00816.39
7.3.210.0130.00716.61
7.3.200.0030.01316.43
7.3.190.0040.01916.31
7.3.180.0130.00916.40
7.3.170.0080.00916.80
7.3.160.0120.00616.41
7.3.120.0000.01414.48
7.3.110.0070.01115.04
7.3.100.0090.00414.66
7.3.90.0030.00715.15
7.3.80.0060.00615.07
7.3.70.0040.01214.94
7.3.60.0130.00014.86
7.3.50.0030.00614.95
7.3.40.0120.00514.81
7.3.30.0100.00014.96
7.3.20.0050.00816.73
7.3.10.0080.00516.61
7.3.00.0090.00116.70
7.2.330.0070.01116.59
7.2.320.0140.00716.82
7.2.310.0090.00816.82
7.2.300.0060.01016.68
7.2.290.0070.01216.89
7.2.250.0090.00915.07
7.2.240.0090.00915.07
7.2.230.0030.01315.18
7.2.220.0060.00614.87
7.2.210.0060.00614.85
7.2.200.0070.00715.27
7.2.190.0040.00715.07
7.2.180.0060.00615.06
7.2.170.0080.00815.04
7.2.160.0060.00615.16
7.2.150.0090.01216.87
7.2.140.0040.00716.75
7.2.130.0100.01016.84
7.2.120.0060.00716.92
7.2.110.0070.00516.92
7.2.100.0040.00716.96
7.2.90.0130.00016.89
7.2.80.0050.00517.04
7.2.70.0040.00716.66
7.2.60.0040.00716.99
7.2.50.0070.01117.01
7.2.40.0100.00316.93
7.2.30.0080.00316.68
7.2.20.0040.01116.89
7.2.10.0040.01116.94
7.2.00.0110.00416.93
7.1.330.0090.00616.00
7.1.320.0030.00615.84
7.1.310.0050.00515.52
7.1.300.0080.00815.70
7.1.290.0030.01015.67
7.1.280.0090.00315.91
7.1.270.0030.00915.66
7.1.260.0060.00615.91
7.1.250.0090.00316.00

preferences:
32.35 ms | 401 KiB | 5 Q