3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = [ [ "forename" => "Dave", "surname" => "Wood", "dob" => "23/05/1986", "gender" => "Male", ], ]; function outputr(array $input) { // work out the max length for each field $lengths = []; foreach ($input as $row) { foreach ($row as $key => $value) { if (!isset($lengths[$key])) { $lengths[$key] = 0; } $kl = strlen($key); $vl = strlen($value); $ln = ($kl > $vl) ? $kl : $vl; if ($ln > $lengths[$key]) { $lengths[$key] = $ln; } } } // output the table headers foreach ($lengths as $key => $length) { echo "+" . str_repeat("-", $length + 2); } echo "+\n"; foreach ($lengths as $key => $length) { $pad = $length - strlen($key); echo "| {$key} " . str_repeat(" ", $pad); } echo "|\n"; foreach ($lengths as $key => $length) { echo "+" . str_repeat("-", $length + 2); } echo "+\n"; } outputr($input);

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.0140.00716.75
8.3.50.0110.00716.66
8.3.40.0100.00718.69
8.3.30.0080.00818.68
8.3.20.0000.00721.73
8.3.10.0070.00021.85
8.3.00.0040.00421.60
8.2.180.0150.00616.75
8.2.170.0080.00822.96
8.2.160.0090.01220.53
8.2.150.0080.00024.18
8.2.140.0000.00724.66
8.2.130.0040.00419.27
8.2.120.0070.00026.35
8.2.110.0060.00321.00
8.2.100.0090.00317.72
8.2.90.0100.00018.03
8.2.80.0050.00318.05
8.2.70.0060.00317.92
8.2.60.0050.00317.93
8.2.50.0040.00418.16
8.2.40.0080.00020.44
8.2.30.0040.00419.40
8.2.20.0030.00518.05
8.2.10.0040.00418.13
8.2.00.0040.00418.01
8.1.280.0080.00625.92
8.1.270.0000.00722.06
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0090.00022.00
8.1.230.0000.01020.94
8.1.220.0000.00817.79
8.1.210.0050.00318.88
8.1.200.0000.00917.22
8.1.190.0000.00917.25
8.1.180.0000.00818.10
8.1.170.0050.00318.90
8.1.160.0050.00218.81
8.1.150.0000.00718.96
8.1.140.0030.00517.78
8.1.130.0000.00818.96
8.1.120.0030.00317.51
8.1.110.0000.00817.48
8.1.100.0030.00517.54
8.1.90.0070.00017.51
8.1.80.0000.00717.48
8.1.70.0000.00717.50
8.1.60.0040.00417.62
8.1.50.0040.00417.43
8.1.40.0080.00017.48
8.1.30.0050.00317.58
8.1.20.0000.00817.49
8.1.10.0040.00717.66
8.1.00.0000.00817.52
8.0.300.0040.00419.53
8.0.290.0080.00016.75
8.0.280.0000.00718.33
8.0.270.0030.00317.17
8.0.260.0030.00318.95
8.0.250.0070.00016.87
8.0.240.0000.00716.96
8.0.230.0040.00416.93
8.0.220.0000.00716.85
8.0.210.0040.00416.88
8.0.200.0000.00816.83
8.0.190.0030.00617.01
8.0.180.0000.00716.99
8.0.170.0040.00416.89
8.0.160.0070.00016.80
8.0.150.0040.00416.80
8.0.140.0000.00716.83
8.0.130.0060.00013.32
8.0.120.0060.00316.80
8.0.110.0080.00016.91
8.0.100.0020.00516.85
8.0.90.0080.00016.73
8.0.80.0070.01016.99
8.0.70.0070.00016.78
8.0.60.0050.00316.93
8.0.50.0050.00316.77
8.0.30.0080.01117.00
8.0.20.0100.00917.41
8.0.10.0000.00716.93
8.0.00.0100.00716.75
7.4.330.0050.00015.55
7.4.320.0030.00316.53
7.4.300.0050.00216.55
7.4.290.0030.00616.50
7.4.280.0040.00416.60
7.4.270.0030.00316.44
7.4.260.0000.00716.53
7.4.250.0000.00716.59
7.4.240.0070.00016.63
7.4.230.0000.00716.69
7.4.220.0040.00416.71
7.4.210.0060.00816.54
7.4.200.0030.00316.62
7.4.160.0090.01016.64
7.4.140.0100.00917.86
7.4.130.0130.01016.59
7.4.120.0100.01016.55
7.4.110.0070.01316.52
7.4.100.0060.01516.32
7.4.90.0100.00616.38
7.4.80.0080.01219.39
7.4.70.0030.01616.45
7.4.60.0080.00716.57
7.4.50.0140.00316.40
7.4.40.0060.01616.45
7.4.00.0030.01314.82
7.3.330.0000.00613.17
7.3.320.0000.00613.38
7.3.310.0040.00416.49
7.3.300.0030.00316.22
7.3.290.0070.00016.25
7.3.280.0090.00916.39
7.3.260.0100.00916.54
7.3.240.0100.00716.63
7.3.230.0090.00816.44
7.3.210.0130.00916.69
7.3.200.0080.00816.67
7.3.190.0120.00916.53
7.3.180.0160.00016.67
7.3.170.0070.01116.50
7.3.160.0060.01116.43
7.3.120.0030.01315.04
7.3.110.0030.01014.82
7.3.100.0000.01314.84
7.3.90.0070.00714.90
7.3.80.0140.00314.87
7.3.70.0040.01114.87
7.3.60.0060.01014.67
7.3.50.0130.00314.87
7.3.40.0030.01414.55
7.3.30.0060.00914.80
7.3.20.0070.01116.85
7.3.10.0080.00916.50
7.3.00.0080.00816.50
7.2.330.0110.00716.57
7.2.320.0090.01416.64
7.2.310.0150.00316.68
7.2.300.0070.01816.73
7.2.290.0060.01216.55
7.2.240.0000.01715.24
7.2.230.0070.01015.01
7.2.220.0120.00314.98
7.2.210.0000.01214.77
7.2.200.0060.00615.01
7.2.190.0030.01014.78
7.2.180.0030.01414.95
7.2.170.0130.00314.94
7.2.160.0050.00514.81
7.2.150.0070.00717.09
7.2.140.0030.01016.72
7.2.130.0110.00516.71
7.2.120.0080.00716.75
7.2.110.0070.00816.65
7.2.100.0050.00616.67
7.2.90.0050.00916.84
7.2.80.0090.00516.81
7.2.70.0080.00916.94
7.2.60.0070.00816.94
7.2.50.0080.00516.67
7.2.40.0170.00617.00
7.2.30.0170.00817.01
7.2.20.0180.01117.08
7.2.10.0160.00917.05
7.2.00.0160.01017.14
7.1.330.0070.01015.74
7.1.320.0000.01015.73
7.1.310.0060.00816.08
7.1.300.0130.00315.44
7.1.290.0130.00015.65
7.1.280.0080.00815.58
7.1.270.0070.00715.96
7.1.260.0070.00415.78
7.1.250.0020.01315.59
7.1.200.0040.00815.87
7.1.160.0390.00916.68
7.1.150.0380.01216.63
7.1.140.0370.00816.97
7.1.130.0350.01016.62
7.1.120.0390.00916.86
7.1.110.0400.00716.11
7.1.100.0400.01016.29
7.1.90.0590.01115.93
7.1.80.0490.01116.41
7.1.70.0540.00915.43
7.1.60.0860.01633.36
7.1.50.1350.01732.99
7.1.40.0710.01432.61
7.1.30.0640.01432.59
7.1.20.0700.01732.70
7.1.10.0490.00914.73
7.1.00.0410.00914.78

preferences:
59.53 ms | 401 KiB | 5 Q