3v4l.org

run code in 300+ PHP versions simultaneously
<?php define('ROWS_PER_PAGE', 10); function display_table($fields, $data, $rows, $page){ if(isset($_GET['page'])){ $page = $_GET['page']; } else { $page = 1; } $firstRecord = ($page - 1) * ROWS_PER_PAGE; $pageNumbers = ceil($rows / ROWS_PER_PAGE); echo '<div class="table-responsive w-75 mx-auto py-3"> <table class="table table-dark table-bordered table-sm"> <thead> <tr>'; foreach($fields as $key){ echo '<th class="py-2">' . $key . '</th>'; } echo '</tr> </thead> </tbody>'; $keys = array_keys($fields); $lastRecord = min($firstRecord + ROWS_PER_PAGE, $rows); for($record = $firstRecord; $record < $lastRecord; $record++){ $row = $data[$record]; echo '<tr>'; for($recordCount = 0; $recordCount < count($keys); $recordCount++){ $column = $keys[$recordCount]; echo '<td class="py-2">' . $row[$column] . '</td>'; } echo '</tr>'; } echo '</tbody> </table'; for($pages = 1; $pages <= $pageNumbers; $pages++){ echo '<a class="btn btn-dark mx-1" href=?page=' . $pages . '</a>'; } } $fields = array( "id" => "Id", "emailaddress" => "Email", "firstname" => "First Name", "lastname" => "Last Name", "salesperson" => "Salesperson", "phonenumber" => "Phone Number", "extension" => "Extension", "type" => "Type" ); $data = array( array('id' => 1, 'emailaddress' => 'user1@example.com', 'firstname' => 'User', 'lastname' => 'One', 'salesperson' => 'y', 'phonenumber' => '1235556789', 'extension' => '1', 'type' => 'a') , array('id' => 2, 'emailaddress' => 'user2@example.com', 'firstname' => 'User', 'lastname' => 'Two', 'salesperson' => 'y', 'phonenumber' => '1235556789', 'extension' => '2', 'type' => 'a') ); display_table($fields, $data, 2, 1);

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.0120.00318.30
8.3.50.0100.00316.41
8.3.40.0110.00622.07
8.3.30.0070.00718.85
8.3.20.0030.00624.18
8.3.10.0070.00024.66
8.3.00.0040.00426.16
8.2.180.0070.00725.92
8.2.170.0110.00418.96
8.2.160.0070.00722.96
8.2.150.0050.00525.66
8.2.140.0040.00424.66
8.2.130.0030.00626.16
8.2.120.0060.00319.36
8.2.110.0100.00020.48
8.2.100.0000.01217.84
8.2.90.0080.00318.09
8.2.80.0000.00818.16
8.2.70.0050.00518.05
8.2.60.0000.00918.22
8.2.50.0030.00518.10
8.2.40.0050.00519.38
8.2.30.0070.00019.27
8.2.20.0070.00018.26
8.2.10.0040.00419.36
8.2.00.0040.00419.45
8.1.280.0040.01125.92
8.1.270.0090.00622.20
8.1.260.0040.00426.35
8.1.250.0090.00028.09
8.1.240.0060.00320.95
8.1.230.0120.00022.81
8.1.220.0040.00417.77
8.1.210.0040.00420.18
8.1.200.0040.00417.48
8.1.190.0080.00017.35
8.1.180.0050.00318.10
8.1.170.0040.00418.70
8.1.160.0040.00418.97
8.1.150.0040.00418.84
8.1.140.0000.00718.98
8.1.130.0000.00717.54
8.1.120.0040.00417.47
8.1.110.0070.00017.43
8.1.100.0000.00717.54
8.1.90.0040.00417.43
8.1.80.0030.00617.59
8.1.70.0040.00417.41
8.1.60.0050.00317.56
8.1.50.0090.00617.55
8.1.40.0040.00417.57
8.1.30.0040.00417.73
8.1.20.0030.00617.61
8.1.10.0000.00817.58
8.1.00.0020.00517.61
8.0.300.0040.00421.90
8.0.290.0000.00716.75
8.0.280.0040.00418.50
8.0.270.0000.00716.95
8.0.260.0000.00716.91
8.0.250.0070.00016.92
8.0.240.0030.00616.91
8.0.230.0000.00816.97
8.0.220.0080.00016.85
8.0.210.0000.00716.96
8.0.200.0030.00317.01
8.0.190.0000.00717.07
8.0.180.0020.00517.05
8.0.170.0030.00617.00
8.0.160.0000.00816.86
8.0.150.0040.00417.00
8.0.140.0000.00716.93
8.0.130.0000.00613.36
8.0.120.0040.00416.96
8.0.110.0000.00817.01
8.0.100.0000.00716.96
8.0.90.0040.00416.96
8.0.80.0070.00816.91
8.0.70.0000.00717.01
8.0.60.0000.00716.87
8.0.50.0000.00716.86
8.0.30.0110.01117.34
8.0.20.0080.01117.19
8.0.10.0040.00417.15
8.0.00.0150.00416.86
7.4.330.0000.00515.55
7.4.320.0030.00316.52
7.4.300.0000.00616.53
7.4.290.0050.00316.66
7.4.280.0060.00616.71
7.4.270.0030.00316.48
7.4.260.0000.00716.66
7.4.250.0070.00016.63
7.4.240.0000.00716.64
7.4.230.0030.00316.76
7.4.220.0040.00416.76
7.4.210.0080.00816.70
7.4.200.0040.00416.76
7.4.130.0060.01316.62
7.4.120.0060.01516.60
7.4.110.0120.00916.53
7.4.100.0080.00616.63
7.4.90.0040.01416.59
7.4.80.0100.01016.72
7.4.70.0180.00616.65
7.4.60.0120.01216.41
7.4.50.0030.02016.65
7.4.40.0130.01016.54
7.4.30.0110.00616.63
7.4.20.0120.00616.48
7.4.10.0150.00316.72
7.4.00.0070.01016.54
7.3.330.0070.00016.32
7.3.320.0060.00013.40
7.3.310.0000.00816.41
7.3.300.0060.00016.46
7.3.290.0070.00816.43
7.3.260.0130.01316.70
7.3.240.0140.00316.59
7.3.230.0160.00616.59
7.3.220.0160.00416.50
7.3.210.0060.02016.79
7.3.200.0130.00616.33
7.3.190.0170.00916.71
7.3.180.0110.00716.73
7.3.170.0090.00916.57
7.3.160.0070.01016.46
7.3.150.0140.00316.66
7.3.140.0060.01216.54
7.3.130.0110.00716.49
7.3.120.0030.01316.69
7.3.110.0040.01316.46
7.3.100.0100.00716.49
7.3.90.0040.01416.68
7.3.80.0190.00316.54
7.3.70.0180.00616.58
7.3.60.0200.00016.53
7.3.50.0000.01816.48
7.3.40.0030.01716.48
7.3.30.0060.01016.43
7.3.20.0120.00616.58
7.3.10.0070.01316.43
7.3.00.0130.01316.47
7.2.340.0060.01216.86
7.2.330.0110.01116.75
7.2.320.0040.01816.71
7.2.310.0070.01116.87
7.2.300.0110.00716.89
7.2.290.0030.01516.84
7.2.280.0090.00916.66
7.2.270.0110.00716.86
7.2.260.0000.01816.50
7.2.250.0140.00416.78
7.2.240.0110.00716.78
7.2.230.0130.00616.69
7.2.220.0120.00916.93
7.2.210.0130.01016.62
7.2.200.0070.01716.63
7.2.190.0000.01716.67
7.2.180.0080.01216.68
7.2.170.0110.01116.66
7.2.160.0090.00916.64
7.2.150.0130.01316.86
7.2.140.0130.01016.77
7.2.130.0060.01916.77
7.2.120.0120.00816.80
7.2.110.0130.00616.76
7.2.100.0160.00316.74
7.2.90.0140.00616.82
7.2.80.0150.00416.56
7.2.70.0060.01316.79
7.2.60.0070.01116.70
7.2.50.0110.00716.75
7.2.40.0070.01316.88
7.2.30.0070.01116.73
7.2.20.0160.00316.71
7.2.10.0440.01616.85
7.2.00.0090.00916.75
7.1.20.0050.00717.30

preferences:
60.89 ms | 400 KiB | 5 Q