3v4l.org

run code in 300+ PHP versions simultaneously
<?php $db = new PDO('sqlite::memory:'); // These are the only reasonable settings to ever use: $db->setAttribute(PDO::ATTR_EMULATE_PREPARES, false); $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); // Let's create a table: $db->exec("CREATE TABLE foo (username TEXT, pwhash TEXT, email TEXT)"); // Dummy rows: $db->exec("INSERT INTO foo(username, pwhash, email) VALUES ('scott', 'lolno', 'scott@paragonie.com')"); $db->exec("INSERT INTO foo(username, pwhash, email) VALUES ('robyn', 'fake!', 'robyn@paragonie.com')"); // Okay, now let's do a prepared statement, with an integer field $int = 12345; $stmt = $db->prepare("SELECT * FROM foo WHERE {$int} = ?"); $stmt->bindValue(1, $int, PDO::PARAM_INT); $stmt->execute(); var_dump($stmt->fetchAll(PDO::FETCH_ASSOC));

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.4.10.0100.00020.17
8.3.140.0110.00017.52
8.3.130.0030.00618.95
8.3.120.0100.00721.40
8.3.110.0130.00320.94
8.3.100.0030.00624.06
8.3.90.0150.00026.77
8.3.80.0100.00317.38
8.3.70.0060.00919.00
8.3.60.0060.00918.72
8.3.50.0150.00419.20
8.3.40.0110.00720.01
8.3.30.0090.00619.63
8.3.20.0040.00424.18
8.3.10.0040.00424.66
8.3.00.0040.00426.16
8.2.250.0030.00619.27
8.2.240.0090.00318.00
8.2.230.0130.00322.58
8.2.220.0030.00637.54
8.2.210.0090.00626.77
8.2.200.0150.00017.50
8.2.190.0090.00617.63
8.2.180.0000.01525.92
8.2.170.0120.00919.79
8.2.160.0120.00322.96
8.2.150.0040.00425.66
8.2.140.0030.00524.66
8.2.130.0040.00426.16
8.2.120.0060.00321.78
8.2.110.0030.00621.09
8.2.100.0000.00923.08
8.1.300.0120.00620.98
8.1.290.0080.00418.88
8.1.280.0130.01025.92
8.1.270.0040.00423.99
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0060.00620.89
8.1.230.0100.00022.99
8.0.70.0100.01017.71

preferences:
44.74 ms | 403 KiB | 5 Q