3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dbh = new PDO("sqlite::memory:"); $calories = (int) 150; $colour = 'red'; $sth = $dbh->prepare('SELECT 1 WHERE 1 = :calories AND 2 = :colour'); if ($sth->bindParam(':calories', $calories, PDO::PARAM_INT) !== true) die('die on ' . __LINE__. "\n"); if ($sth->bindValue(':colour', $colour, PDO::PARAM_STR) !== true) die('die on ' . __LINE__. "\n"); $sth->debugDumpParams();
Output for 5.5.0 - 5.5.38, 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.25, 8.0.0 - 8.0.12, 8.1rc1 - rc3
SQL: [44] SELECT 1 WHERE 1 = :calories AND 2 = :colour Params: 2 Key: Name: [9] :calories paramno=-1 name=[9] ":calories" is_param=1 param_type=1 Key: Name: [7] :colour paramno=-1 name=[7] ":colour" is_param=1 param_type=2

preferences:
41.03 ms | 462 KiB | 5 Q