3v4l.org

run code in 300+ PHP versions simultaneously
<?php // @see https://gist.github.com/adrian-enspired/385c6830ba2932bc36a2 $db = new PDO($dsn, $user, $pass, $options); $stmt = $db->prepare("INSERT INTO data (fetched_url, author) VALUES (?, ?)"); // example data $posts = [ [ 'data' => [ 'url' => 'https://hashphp.org', 'author_fullname' => 'alvisleet' ] ], [ 'data' => [ 'url' => 'https://hashphp.org', 'author_fullname' => 'alvisleet' ] ] ]; foreach ($posts as $post) { $stmt->execute([$post['data']['url'], $post['data']['author_fullname']]); }
Output for git.master, git.master_jit
Warning: Undefined variable $dsn in /in/FWKgf on line 4 Warning: Undefined variable $user in /in/FWKgf on line 4 Warning: Undefined variable $pass in /in/FWKgf on line 4 Warning: Undefined variable $options in /in/FWKgf on line 4 Deprecated: PDO::__construct(): Passing null to parameter #1 ($dsn) of type string is deprecated in /in/FWKgf on line 4 Fatal error: Uncaught PDOException: PDO::__construct(): Argument #1 ($dsn) must be a valid data source name in /in/FWKgf:4 Stack trace: #0 /in/FWKgf(4): PDO->__construct('', NULL, Object(SensitiveParameterValue), NULL) #1 {main} thrown in /in/FWKgf on line 4
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:
45.81 ms | 409 KiB | 5 Q