3v4l.org

run code in 300+ PHP versions simultaneously
<?php $pdo = new PDO('sqlite::memory:'); $pdo->exec("CREATE TABLE foo (id int)"); $pdo->exec("INSERT INTO foo VALUES (1)"); $stmt = $pdo->query("SELECT id FROM foo"); var_dump($stmt->fetchColumn(0));
Output for 8.1.0 - 8.1.29, 8.2.0 - 8.2.21, 8.3.0 - 8.3.9
int(1)
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.0.31, 7.1.0 - 7.1.25, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30
string(1) "1"

preferences:
187.97 ms | 403 KiB | 248 Q