3v4l.org

run code in 300+ PHP versions simultaneously
<?php $query = 'UPDATE `list?` set `item`=?,`type`=? WHERE ( "ty?pe?"<> \'Are yo?\' `id` = ?);'; $params = array( 'item' => '1', 'type' => 'Are you o\'k?', 'id' => '2' ); function substitute_params($query, $params) { $prep_params = str_replace(array("'","?"),array("''","\\?"),$params); $query = array_reduce($prep_params, function ($interm, $param) { return preg_replace('/^([^"\'`]*?(?:(?:`[^`]*?`[^"\'`]*?)*?(?:"[^"]*?"[^"\'`]*?)*?(?:\'[^\']*?\'[^\'"`]*?)*?)*?)(?<!\\\\)\\?/m', '${1}'.(is_numeric($param) ? $param : '\'' . $param . '\''), $interm, 1); }, $query); return "-- Not to be used as a query to database. For demonstration purposes only!\n" .str_replace("\\?", "?", $query); } echo substitute_params($query, $params); ?>
Output for git.master, git.master_jit, rfc.property-hooks
-- Not to be used as a query to database. For demonstration purposes only! UPDATE `list?` set `item`=1,`type`='Are you o''k?' WHERE ( "ty?pe?"<> 'Are yo?' `id` = 2);

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:
43.13 ms | 405 KiB | 5 Q