3v4l.org

run code in 300+ PHP versions simultaneously
<?php $pdo = new PDO('sqlite::memory:'); $pdo->exec('CREATE TABLE test (a INTEGER, b BLOB);'); $fp = tmpfile(); fwrite($fp, 'Random stuff!'); fseek($fp, 0); $stmt = $pdo->prepare('INSERT INTO test VALUES (?, ?);'); $stmt->bindValue(1, 42); $stmt->bindParam(2, $fp, PDO::PARAM_LOB); $stmt->execute(); var_dump(gettype($fp));

preferences:
54.48 ms | 402 KiB | 5 Q