3v4l.org

run code in 300+ PHP versions simultaneously
<?php $idx = [[1,10],[2,4],[3,5]]; $x = array_column($idx,0); $y = array_column($idx,1); $string_y = ''; $string_x = ''; if(count($x) == count($y)){ $i = 0; foreach($x as $key => $value){ if ($key === array_key_last($x)) { $string_y .= $y[$key]; $string_x .= $x[$key]; }else{ $string_y .= $y[$key] . ','; $string_x .= $x[$key] . ','; } } $sql = "SELECT id, b1, b2 FROM dlt WHERE b1 IN ($string_x) AND b2 IN ($string_y) ORDER BY id DESC LIMIT 1"; echo $sql; }
Output for git.master, git.master_jit, rfc.property-hooks
SELECT id, b1, b2 FROM dlt WHERE b1 IN (1,2,3) AND b2 IN (10,4,5) ORDER BY id DESC LIMIT 1

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