3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * Translate a result array into a HTML table * * @author Aidan Lister <aidan@php.net> * @version 1.3.2 * @link http://aidanlister.com/2004/04/converting-arrays-to-human-readable-tables/ * @param array $array The result (numericaly keyed, associative inner) array. * @param bool $recursive Recursively generate tables for multi-dimensional arrays * @param string $null String to output for blank cells */ function array2table($array, $recursive = false, $null = '&nbsp;') { // Sanity check if (empty($array) || !is_array($array)) { return false; } if (!isset($array[0]) || !is_array($array[0])) { $array = array($array); } // Start the table $table = "<table>\n"; // The header $table .= "\t<tr>"; // Take the keys from the first row as the headings foreach (array_keys($array[0]) as $heading) { $table .= '<th>' . $heading . '</th>'; } $table .= "</tr>\n"; // The body foreach ($array as $row) { $table .= "\t<tr>" ; foreach ($row as $cell) { $table .= '<td>'; // Cast objects if (is_object($cell)) { $cell = (array) $cell; } if ($recursive === true && is_array($cell) && !empty($cell)) { // Recursive mode $table .= "\n" . array2table($cell, true, true) . "\n"; } else { $table .= (strlen($cell) > 0) ? htmlspecialchars((string) $cell) : $null; } $table .= '</td>'; } $table .= "</tr>\n"; } $table .= '</table>'; return $table; } $data ='[{ "ObjectId": 43, "ObjectName": "MEGA MELA", "ObjectTitle": "Event Created by API", "ObjectDescription": "NEW EVENT BY API", "ObjectLabel": "", "ObjectTypeId": 33, "MaxFieldsExpected": 5, "ObjectValueType": null, "ObjectControlType": "", "IsDeleted": true, "CreatedDate": "2019-05-22T07:56:03.767", "CreatedBy": null, "EditedDate": null, "EditedBy": null, "DeletedDate": null }]'; $jsonData = json_decode($data, TRUE); echo array2table($jsonData);

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.5.10.0060.00216.87
8.5.00.0140.00820.10
8.4.160.0140.00824.00
8.4.150.0020.00114.05
8.4.140.0120.00917.64
8.4.130.0100.00118.02
8.4.120.0060.00222.19
8.4.110.0110.00920.66
8.4.100.0090.01217.93
8.4.90.0120.00918.05
8.4.80.0090.01120.73
8.4.70.0110.00917.79
8.4.60.0160.00517.98
8.4.50.0120.00818.75
8.4.40.0120.00917.69
8.4.30.0060.01318.86
8.4.20.0190.00018.01
8.4.10.0000.00919.43
8.3.280.0120.00920.28
8.3.270.0100.01016.66
8.3.260.0150.00516.72
8.3.250.0090.00718.94
8.3.240.0110.00816.84
8.3.230.0080.00317.08
8.3.220.0120.00717.34
8.3.210.0120.00416.82
8.3.200.0090.01019.08
8.3.190.0100.01018.39
8.3.180.0110.00816.89
8.3.170.0120.00620.79
8.3.160.0080.00018.61
8.3.150.0100.01020.84
8.3.140.0080.00016.50
8.3.130.0070.00318.67
8.3.120.0030.00619.13
8.3.110.0060.00320.94
8.3.100.0130.00618.33
8.3.90.0090.00926.77
8.3.80.0040.00417.97
8.3.70.0030.01316.59
8.3.60.0060.00916.75
8.3.50.0120.00616.75
8.3.40.0160.00321.88
8.3.30.0100.01020.67
8.3.20.0040.00424.18
8.3.10.0040.00424.66
8.3.00.0040.00426.16
8.2.290.0050.00420.79
8.2.280.0060.01216.86
8.2.270.0120.00917.19
8.2.260.0140.00319.11
8.2.250.0040.00416.76
8.2.240.0000.00916.93
8.2.230.0060.00622.58
8.2.220.0090.00024.06
8.2.210.0110.00426.77
8.2.200.0030.00616.75
8.2.190.0040.01116.63
8.2.180.0090.00618.54
8.2.170.0070.00719.13
8.2.160.0070.00722.96
8.2.150.0040.00425.66
8.2.140.0060.00324.66
8.2.130.0090.00626.16
8.2.120.0040.00420.78
8.2.110.0160.00620.30
8.2.100.0140.01018.72
8.2.90.0070.01419.04
8.2.80.0110.00418.85
8.2.70.0160.00718.77
8.2.60.0110.00718.65
8.2.50.0100.00318.76
8.2.40.0050.00518.90
8.2.30.0030.00618.74
8.2.20.0060.00318.71
8.2.10.0030.00718.83
8.2.00.0090.00018.84
8.1.330.0110.00816.72
8.1.320.0110.00815.96
8.1.310.0120.00318.54
8.1.300.0120.00616.25
8.1.290.0060.00630.84
8.1.280.0100.01025.92
8.1.270.0080.00024.66
8.1.260.0080.00026.35
8.1.250.0080.00028.09
8.1.240.0160.00618.57
8.1.230.0190.00318.59
8.1.220.0100.00018.55
8.1.210.0030.00619.88
8.1.200.0090.00018.42
8.1.190.0100.01318.43
8.1.180.0030.00718.31
8.1.170.0040.00718.49
8.1.160.0190.00418.67
8.1.150.0170.00718.49
8.1.140.0140.00718.61
8.1.130.0100.00718.48
8.1.120.0120.00918.49
8.1.110.0120.00318.55
8.1.100.0100.00018.55
8.1.90.0030.00718.55
8.1.80.0070.00318.55
8.1.70.0100.00018.55
8.1.60.0000.01018.67
8.1.50.0070.00318.49
8.1.40.0070.00318.73
8.1.30.0100.00018.69
8.1.20.0030.00718.74
8.1.10.0070.00318.63
8.1.00.0070.00318.48
8.0.300.0070.00317.82
8.0.290.0040.00717.78
8.0.280.0090.00317.60
8.0.270.0070.00317.90
8.0.260.0100.00017.79
8.0.250.0030.00617.86
8.0.240.0090.00017.80
8.0.230.0070.00317.57
8.0.220.0090.00017.79
8.0.210.0030.00617.85
8.0.200.0000.01117.82
8.0.190.0080.00417.80
8.0.180.0060.00617.88
8.0.170.0070.00317.98
8.0.160.0030.00717.86
8.0.150.0100.00017.79
8.0.140.0070.00317.71
8.0.130.0030.00617.89
8.0.120.0030.00617.93
8.0.110.0050.00518.05
8.0.100.0100.00017.71
8.0.90.0070.00317.60
8.0.80.0000.01117.88
8.0.70.0030.00717.88
8.0.60.0070.00317.85
8.0.50.0030.00717.88
8.0.30.0030.00718.00
8.0.20.0080.00418.00
8.0.10.0080.00418.04

preferences:
34.32 ms | 403 KiB | 5 Q