3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Create connection $start = microtime(TRUE); error_log('Connecting'); $connection=mysqli_connect("localhost","******","*****","*****"); error_log('Connection took' . microtime(TRUE) - $start); // Check connection if ($connection == false) { die("ERROR: Could not connect. " .mysqli_connect_error()); } // This SQL statement selects ALL from the table 'Locations' $sql = "SELECT * FROM Notes"; error_log('Running select'); if ($result = mysqli_query($connection, $sql)){ error_log('Select took' . microtime(TRUE) - $start); // If so, then create a results array and a temporary one // to hold the data $resultArray = array(); // Loop through each row in the result set error_log('looping fetch'); while($row = $result->fetch_object()) { error_log('Fetch is running at ' . microtime(TRUE) - $start); // Add each row into our results array $resultArray[] = $row; } // Finally, encode the array to JSON and output the results echo json_encode($resultArray); } error_log('Fetch is done at ' . microtime(TRUE) - $start); // Close connections mysqli_close($connection); error_log('Connection closed at ' . microtime(TRUE) - $start); ?>

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.1.80.0090.00317.28
8.1.70.0050.00517.41
8.1.60.0100.00517.46
8.1.50.0130.00417.50
8.1.40.0070.00317.43
8.1.30.0150.00317.63
8.1.20.0180.00017.60
8.1.10.0110.00617.58
8.1.00.0030.01517.42
8.0.210.0070.00716.74
8.0.200.0150.00016.95
8.0.190.0150.00016.89
8.0.180.0120.00416.88
8.0.170.0080.00616.79
8.0.160.0070.00716.79
8.0.150.0120.00416.76
8.0.140.0120.00316.88
8.0.130.0100.00616.81
8.0.120.0040.00716.86
8.0.110.0070.00716.80
8.0.100.0110.00416.70
8.0.90.0140.00016.86
8.0.80.0060.00816.81
8.0.70.0160.00016.78
8.0.60.0110.00416.76
8.0.50.0130.00016.84
8.0.30.0110.00616.79
8.0.20.0110.00416.84
8.0.10.0160.00016.91
7.4.300.0140.00316.51
7.4.290.0110.00016.45
7.4.280.0150.00416.61
7.4.270.0080.00516.60
7.4.260.0130.00616.47
7.4.250.0070.00416.56
7.4.240.0080.00416.60
7.4.230.0120.00816.40
7.4.220.0130.00416.39
7.4.210.0100.00716.41
7.4.200.0080.00816.51
7.4.190.0160.00016.66
7.4.180.0060.00616.51
7.4.160.0130.00016.60
7.4.150.0050.00516.37
7.4.140.0000.01116.43
7.4.130.0110.00416.37
7.4.120.0100.00516.43
7.4.110.0050.00516.49
7.4.100.0090.00616.42
7.4.90.0100.00716.45
7.4.80.0120.00416.49
7.4.70.0070.00716.33
7.4.60.0040.00916.34
7.4.50.0090.00316.38
7.4.40.0060.00616.45
7.4.30.0050.00616.45
7.4.20.0050.00516.48
7.4.10.0120.00016.35
7.4.00.0050.00516.38

preferences:
47 ms | 403 KiB | 5 Q