3v4l.org

run code in 300+ PHP versions simultaneously
<?php $table_arr = array('al5data','al6data'); //if (empty($table_arr)) $table_arr[]=$this->table; //if (in_array('al5data',$table_arr)) $idfield = 'dataid'; // else $idfield = 'data_id'; //if (empty($id_arr)) $id_arr = $this->id_arr; $query =""; foreach ($table_arr AS $table) { $idfield = $this->getPriKey($table); if ('al5data' !== $table) $query .= " UNION "; $query .= "(SELECT `$idfield`, `pt_last_name`, `pt_first_name`, `start_date`, \"" . $table . "\" AS `table` FROM `" . $table . "`)"; } $query .= " ORDER BY STR_TO_DATE(`start_date`, '%m/%d/%Y') DESC, `$idfield` DESC LIMIT 0,100"; echo $query;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 21
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 21
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 12
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 12
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
filename:       /in/IqbOu
function name:  (null)
number of ops:  28
compiled vars:  !0 = $table_arr, !1 = $query, !2 = $table, !3 = $idfield
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   10     1        ASSIGN                                                   !1, ''
   11     2      > FE_RESET_R                                       $6      !0, ->21
          3    > > FE_FETCH_R                                               $6, !2, ->21
   13     4    >   FETCH_THIS                                       $7      
          5        INIT_METHOD_CALL                                         $7, 'getPriKey'
          6        SEND_VAR_EX                                              !2
          7        DO_FCALL                                      0  $8      
          8        ASSIGN                                                   !3, $8
   14     9        IS_NOT_IDENTICAL                                         !2, 'al5data'
         10      > JMPZ                                                     ~10, ->12
         11    >   ASSIGN_OP                                     8          !1, '+UNION+'
   15    12    >   ROPE_INIT                                     3  ~13     '%28SELECT+%60'
         13        ROPE_ADD                                      1  ~13     ~13, !3
         14        ROPE_END                                      2  ~12     ~13, '%60%2C+%60pt_last_name%60%2C+%60pt_first_name%60%2C+%60start_date%60%2C+%22'
         15        CONCAT                                           ~15     ~12, !2
         16        CONCAT                                           ~16     ~15, '%22+AS+%60table%60+FROM+%60'
         17        CONCAT                                           ~17     ~16, !2
         18        CONCAT                                           ~18     ~17, '%60%29'
         19        ASSIGN_OP                                     8          !1, ~18
   11    20      > JMP                                                      ->3
         21    >   FE_FREE                                                  $6
   17    22        ROPE_INIT                                     3  ~21     '+ORDER+BY+STR_TO_DATE%28%60start_date%60%2C+%27%25m%2F%25d%2F%25Y%27%29+DESC%2C+%60'
         23        ROPE_ADD                                      1  ~21     ~21, !3
         24        ROPE_END                                      2  ~20     ~21, '%60+DESC+LIMIT+0%2C100'
         25        ASSIGN_OP                                     8          !1, ~20
   19    26        ECHO                                                     !1
         27      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
193.98 ms | 940 KiB | 14 Q