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;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 38
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 38
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 16
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 24, Position 2 = 32
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 36
Branch analysis from position: 36
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 16
Branch analysis from position: 38
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 38
filename:       /in/4GZ3N
function name:  (null)
number of ops:  41
compiled vars:  !0 = $blog_id, !1 = $params, !2 = $query, !3 = $values, !4 = $param
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, 10
    6     1        ASSIGN                                                   !1, <array>
   11     2        ROPE_INIT                                     3  ~8      'select+%2A+from+wp_'
          3        ROPE_ADD                                      1  ~8      ~8, !0
          4        ROPE_END                                      2  ~7      ~8, '_posts+where+id+in+%28'
          5        ASSIGN                                                   !2, ~7
   13     6      > FE_RESET_R                                       $11     !1, ->38
          7    > > FE_FETCH_R                                       ~12     $11, !3, ->38
          8    >   ASSIGN                                                   !4, ~12
   14     9        INIT_FCALL                                               'substr'
         10        SEND_VAR                                                 !2
         11        SEND_VAL                                                 -13
         12        DO_ICALL                                         $14     
         13        IS_NOT_EQUAL                                             $14, 'where+id+in+%28'
         14      > JMPZ                                                     ~15, ->16
   15    15    >   ASSIGN_OP                                     8          !2, '+and+id+in+%28'
   17    16    >   ROPE_INIT                                     5  ~18     'select+post_id+from+wp_'
         17        ROPE_ADD                                      1  ~18     ~18, !0
         18        ROPE_ADD                                      2  ~18     ~18, '_postmeta+where+meta_key+%3D+%27'
         19        ROPE_ADD                                      3  ~18     ~18, !4
         20        ROPE_END                                      4  ~17     ~18, '%27+and+meta_value+'
         21        ASSIGN_OP                                     8          !2, ~17
   18    22        TYPE_CHECK                                  128          !3
         23      > JMPZ                                                     ~22, ->32
   19    24    >   ASSIGN_OP                                     8          !2, 'in+%28%27'
   20    25        INIT_FCALL                                               'implode'
         26        SEND_VAL                                                 '%27%2C%27'
         27        SEND_VAR                                                 !3
         28        DO_ICALL                                         $24     
         29        ASSIGN_OP                                     8          !2, $24
   21    30        ASSIGN_OP                                     8          !2, '%27%29'
         31      > JMP                                                      ->36
   24    32    >   ROPE_INIT                                     3  ~28     '%3D+%27'
         33        ROPE_ADD                                      1  ~28     ~28, !3
         34        ROPE_END                                      2  ~27     ~28, '%27'
         35        ASSIGN_OP                                     8          !2, ~27
   26    36    >   ASSIGN_OP                                     8          !2, '%29'
   13    37      > JMP                                                      ->7
         38    >   FE_FREE                                                  $11
   29    39        ECHO                                                     !2
         40      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.92 ms | 1400 KiB | 17 Q