3v4l.org

run code in 500+ PHP versions simultaneously
<?php $rego_columns = [ "make", "model", "year", "rego", ]; $record = ['make' => 'A', 'model' => 'B', 'year' => 'C', 'rego' => 'D']; $tableValues = array_map(function($r) use ($record) { return $record[$r]; }, $rego_columns); $placeholders = implode(',', array_fill(0, count($tableValues), '?')); $tableColumns = '`' . implode('`,`', $rego_columns) . '`'; $query = 'INSERT INTO table_name (' . $tableColumns . ') VALUES(' . $placeholders . ')'; echo $query;
Output for rfc.property-hooks, git.master, git.master_jit
INSERT INTO table_name (`make`,`model`,`year`,`rego`) VALUES(?,?,?,?)

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:
46.81 ms | 1461 KiB | 4 Q