3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $params = [ 'types' => 'sss', 'endtime' => '000', 'restart' => '999', 'id' => $serverid ]; $query = 'UPDATE %s SET endtime = ?, evcomment = "Errors: Interrupted" WHERE starttime = endtime AND starttime < ? AND server = ?'; foreach ([ 'events', 'ongoing_events' ] as $table) { printf($query, $table); echo PHP_EOL; print_r($params); echo PHP_EOL; }
based on 9FUHh
Output for 7.0.0 - 7.2.0
Notice: Undefined variable: serverid in /in/OF0hm on line 7 UPDATE events SET endtime = ?, evcomment = "Errors: Interrupted" WHERE starttime = endtime AND starttime < ? AND server = ? Array ( [types] => sss [endtime] => 000 [restart] => 999 [id] => ) UPDATE ongoing_events SET endtime = ?, evcomment = "Errors: Interrupted" WHERE starttime = endtime AND starttime < ? AND server = ? Array ( [types] => sss [endtime] => 000 [restart] => 999 [id] => )
Output for 5.4.11 - 5.6.28
Notice: Undefined variable: serverid in /in/OF0hm on line 8 UPDATE events SET endtime = ?, evcomment = "Errors: Interrupted" WHERE starttime = endtime AND starttime < ? AND server = ? Array ( [types] => sss [endtime] => 000 [restart] => 999 [id] => ) UPDATE ongoing_events SET endtime = ?, evcomment = "Errors: Interrupted" WHERE starttime = endtime AND starttime < ? AND server = ? Array ( [types] => sss [endtime] => 000 [restart] => 999 [id] => )
Output for 5.3.21 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/OF0hm on line 3
Process exited with code 255.