3v4l.org

run code in 300+ PHP versions simultaneously
<?php $pdo = new pdo('sqlite::memory:', null, null, [PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,PDO::ATTR_EMULATE_PREPARES => false]); $pdo->exec('create table test1 (id int, name text)'); $pdo->exec("insert into test1(id, name) values (1, 'abc'), (2, 'def')"); $stmt = $pdo->prepare('SELECT * FROM test1 WHERE id = :id AND name = :name'); var_dump($stmt->execute(['name' => 'abc', 'id' => 1])); foreach ($stmt as $row) { print_r($row); } echo "\n-----\n"; var_dump($stmt->execute(['name' => 'abc', 1])); foreach ($stmt as $row) { print_r($row); } echo "\n-----\n"; var_dump($stmt->execute(['name' => 'abc', 2])); foreach ($stmt as $row) { print_r($row); } echo "\n-----\n";
Output for git.master, git.master_jit, rfc.property-hooks
bool(true) Array ( [id] => 1 [0] => 1 [name] => abc [1] => abc ) ----- bool(true) Array ( [id] => 1 [0] => 1 [name] => abc [1] => abc ) ----- bool(true) -----

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
82.85 ms | 401 KiB | 8 Q