3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $event_types = array('ea', 'ec'); $type_count = count($event_types); $evtypes = rtrim(str_repeat('?,', $type_count), ','); $query = <<<QUERY DELETE FROM events WHERE evtype IN($evtypes) AND cameraid = ? AND endtime < ? QUERY; $params['types'] = str_repeat('s', $type_count) . 'si'; $params += $event_types; var_export($query); var_export($params);
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
' DELETE FROM events WHERE evtype IN(?,?) AND cameraid = ? AND endtime < ?'array ( 'types' => 'sssi', 0 => 'ea', 1 => 'ec', )