3v4l.org

run code in 300+ PHP versions simultaneously
<?php $fields = "email,first,last,business,home,cell,street,city,state,zip,system,cameras,hdd"; $sql_header = ''; $sql_values = ''; $glue = ''; array_filter( explode(',', $fields), function ($field) use (& $sql_header, & $sql_values, & $glue) { $sql_header .= $glue . '`' . $field . '`'; $sql_values .= $glue . "'" . $field . "'"; $glue = ','; } ); echo ("INSERT INTO `customers`($sql_header) VALUES ($sql_values)");
Output for git.master, git.master_jit, rfc.property-hooks
INSERT INTO `customers`(`email`,`first`,`last`,`business`,`home`,`cell`,`street`,`city`,`state`,`zip`,`system`,`cameras`,`hdd`) VALUES ('email','first','last','business','home','cell','street','city','state','zip','system','cameras','hdd')

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.51 ms | 401 KiB | 8 Q