3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $fields = "email,first,last,business,home,cell,street,city,state,zip,system,cameras,hdd"; $sql_header = ''; $sql_values = ''; $glue = ''; array_walk( 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 5.3.0 - 5.4.22
Parse error: syntax error, unexpected '}' in /in/9gDdr on line 19
Process exited with code 255.