3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dbh = new PDO("sqlite::memory:", "", "", [PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION]); $dbh->exec("CREATE TABLE fruits (name TEXT, color TEXT)"); $dbh->exec("INSERT INTO fruits VALUES('banana', 'yellow')"); $sql = "SELECT * FROM fruits WHERE name = :name AND color = ?"; $sth = $dbh->prepare($sql); $sth->execute(["banana", "yellow"]); var_dump($sth->fetchAll());

preferences:
53.63 ms | 402 KiB | 5 Q