3v4l.org

run code in 300+ PHP versions simultaneously
<?php $table = 'test'; $tableNames= array('col1' => 'str', 'col2' => 3, 'col4' => 5.5); $query = "INSERT INTO $table ("; $query .= implode(', ', array_keys($tableNames)); $query .= ") VALUES ("; $query .= str_repeat('?, ', count($tableNames) - 1); $query .= "?)"; echo $query; $types = str_repeat('s', count($tableNames)); $stmt->bind_param($types, ...$tableNames);
Output for git.master, git.master_jit, rfc.property-hooks
INSERT INTO test (col1, col2, col4) VALUES (?, ?, ?) Warning: Undefined variable $stmt in /in/SleN0 on line 15 Fatal error: Uncaught Error: Call to a member function bind_param() on null in /in/SleN0:15 Stack trace: #0 {main} thrown in /in/SleN0 on line 15
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:
97.02 ms | 405 KiB | 5 Q