3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $parameters=array(); $parameters[0] = 'UPDATE applications SET service=?,acronym=?,email=? WHERE id=2'; $parameters[1] = '"value1","value2","value3"'; $query = array_shift($parameters); $parameter_array = explode(",",$parameters[0]); foreach ($parameter_array as $key => $a_parameter) { $parameter_array[$key] = trim($a_parameter, '"'); } //$statement = $db->prepare($query); echo "The query is:".$query."\n"; //try // { // $statement->execute($parameter_array); print_r($parameter_array); // } //catch (PDOException $error) //{ // echo $error -> getMessage(); //} }
Output for 5.3.0 - 5.4.16
Parse error: syntax error, unexpected '}' in /in/FUlXC on line 35
Process exited with code 255.