3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $cod_videoconferencia[1] = array(1 => 1, 5 => 5, 6 => 6, 7 => 7, 11 => 11, 12 => 12, 13 => 13, 15 => 15); $cod_videoconferencia[2] = array(2 => 2, 5 => 5, 8 => 8, 9 => 9, 11 => 11, 12 => 12, 14 => 14, 15 => 15); $cod_videoconferencia[3] = array(3 => 3, 6 => 6, 8 => 8, 10 => 10, 11 => 11, 13 => 13, 14 => 14, 15 => 15); $cod_videoconferencia[4] = array(4 => 4, 7 => 7, 9 => 9, 10 => 10, 12 => 12, 13 => 13, 14 => 14, 15 => 15); $cod_videoconferencia[5] = $cod_videoconferencia[1] + $cod_videoconferencia[2]; $cod_videoconferencia[6] = $cod_videoconferencia[1] + $cod_videoconferencia[3]; $cod_videoconferencia[7] = $cod_videoconferencia[1] + $cod_videoconferencia[4]; $cod_videoconferencia[8] = $cod_videoconferencia[2] + $cod_videoconferencia[3]; $cod_videoconferencia[9] = $cod_videoconferencia[2] + $cod_videoconferencia[4]; $cod_videoconferencia[10] = $cod_videoconferencia[3] + $cod_videoconferencia[4]; $cod_videoconferencia[11] = $cod_videoconferencia[1] + $cod_videoconferencia[2] + $cod_videoconferencia[3]; $cod_videoconferencia[12] = $cod_videoconferencia[1] + $cod_videoconferencia[2] + $cod_videoconferencia[4]; $cod_videoconferencia[13] = $cod_videoconferencia[1] + $cod_videoconferencia[3] + $cod_videoconferencia[4]; $cod_videoconferencia[14] = $cod_videoconferencia[2] + $cod_videoconferencia[3] + $cod_videoconferencia[4]; $cod_videoconferencia[15] = $cod_videoconferencia[1] + $cod_videoconferencia[2] + $cod_videoconferencia[3] + $cod_videoconferencia[4]; $sql_videoconferencia = "AND ("; foreach ($cod_videoconferencia as $key => $value) { $sql_videoconferencia .= " AND ".$key." NOT IN (".implode(",", $cod_videoconferencia[$key]).")"; } echo $sql_videoconferencia;
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
AND ( AND 1 NOT IN (1,5,6,7,11,12,13,15) AND 2 NOT IN (2,5,8,9,11,12,14,15) AND 3 NOT IN (3,6,8,10,11,13,14,15) AND 4 NOT IN (4,7,9,10,12,13,14,15) AND 5 NOT IN (1,5,6,7,11,12,13,15,2,8,9,14) AND 6 NOT IN (1,5,6,7,11,12,13,15,3,8,10,14) AND 7 NOT IN (1,5,6,7,11,12,13,15,4,9,10,14) AND 8 NOT IN (2,5,8,9,11,12,14,15,3,6,10,13) AND 9 NOT IN (2,5,8,9,11,12,14,15,4,7,10,13) AND 10 NOT IN (3,6,8,10,11,13,14,15,4,7,9,12) AND 11 NOT IN (1,5,6,7,11,12,13,15,2,8,9,14,3,10) AND 12 NOT IN (1,5,6,7,11,12,13,15,2,8,9,14,4,10) AND 13 NOT IN (1,5,6,7,11,12,13,15,3,8,10,14,4,9) AND 14 NOT IN (2,5,8,9,11,12,14,15,3,6,10,13,4,7) AND 15 NOT IN (1,5,6,7,11,12,13,15,2,8,9,14,3,10,4)