3v4l.org

run code in 300+ PHP versions simultaneously
<?php //global $blog_id; $blog_id = 10; //might use $site_id instead $params = array( 'publication_or_data' => 'Publication', 'category' => 'Published/Forthcoming', ); $query = "select * from wp_{$blog_id}_posts where id in ("; foreach($params as $param => $values) { if(substr($query, -13) != 'where id in (') { $query .= " and id in ("; } $query .= "select post_id from wp_{$blog_id}_postmeta where meta_key = '{$param}' and meta_value "; if(is_array($values)) { $query .= "in ('"; $query .= implode("','",$values); $query .= "')"; } else { $query .= "= '{$values}'"; } $query .= ")"; } echo $query;
Output for git.master, git.master_jit, rfc.property-hooks
select * from wp_10_posts where id in (select post_id from wp_10_postmeta where meta_key = 'publication_or_data' and meta_value = 'Publication') and id in (select post_id from wp_10_postmeta where meta_key = 'category' and meta_value = 'Published/Forthcoming')

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:
45.61 ms | 402 KiB | 8 Q