3v4l.org

run code in 300+ PHP versions simultaneously
<?php $db = new pdo('sqlite::memory:', null, null, [PDO::ATTR_ERRMODE=>PDO::ERRMODE_EXCEPTION]); $db->exec('create table foo( n INT UNIQUE );'); $n = 1; $insert = $db->prepare('insert into foo(n) values(:n)'); $insert->bindParam('n', $n); for ($i=0; $i<5; $i++) { try { $db->exec(); } catch (PDOException $e) { // assiming duplicate $n++; } }
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught ArgumentCountError: PDO::exec() expects exactly 1 argument, 0 given in /in/df7gX:13 Stack trace: #0 /in/df7gX(13): PDO->exec() #1 {main} thrown in /in/df7gX on line 13
Process exited with code 255.

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:
60.11 ms | 401 KiB | 8 Q