3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array_table_name = [ 'table_1', 'table_2', 'table_3', ]; $search_id = 1; $selectsArray = []; foreach ($array_table_name as $table_name) { $selectsArray[] = "SELECT * FROM $table_name WHERE id='$search_id'\n"; } $selectsUnion = implode("UNION ALL\n", $selectsArray) . "ORDER BY date_added \nLIMIT 1"; echo $selectsUnion;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 13
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 13
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/HXH2K
function name:  (null)
number of ops:  22
compiled vars:  !0 = $array_table_name, !1 = $search_id, !2 = $selectsArray, !3 = $table_name, !4 = $selectsUnion
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    9     1        ASSIGN                                                   !1, 1
   11     2        ASSIGN                                                   !2, <array>
   12     3      > FE_RESET_R                                       $8      !0, ->13
          4    > > FE_FETCH_R                                               $8, !3, ->13
   13     5    >   ROPE_INIT                                     5  ~11     'SELECT+%2A+FROM+'
          6        ROPE_ADD                                      1  ~11     ~11, !3
          7        ROPE_ADD                                      2  ~11     ~11, '+WHERE+id%3D%27'
          8        ROPE_ADD                                      3  ~11     ~11, !1
          9        ROPE_END                                      4  ~10     ~11, '%27%0A'
         10        ASSIGN_DIM                                               !2
         11        OP_DATA                                                  ~10
   12    12      > JMP                                                      ->4
         13    >   FE_FREE                                                  $8
   16    14        INIT_FCALL                                               'implode'
         15        SEND_VAL                                                 'UNION+ALL%0A'
         16        SEND_VAR                                                 !2
         17        DO_ICALL                                         $14     
         18        CONCAT                                           ~15     $14, 'ORDER+BY+date_added+%0ALIMIT+1'
         19        ASSIGN                                                   !4, ~15
   18    20        ECHO                                                     !4
   19    21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
136.83 ms | 998 KiB | 14 Q