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 ($this->getTable() !== $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 = 24
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 24
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 15
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 15
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
filename:       /in/vIeic
function name:  (null)
number of ops:  31
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, ->24
          3    > > FE_FETCH_R                                               $6, !2, ->24
   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        FETCH_THIS                                       $10     
         10        INIT_METHOD_CALL                                         $10, 'getTable'
         11        DO_FCALL                                      0  $11     
         12        IS_NOT_IDENTICAL                                         !2, $11
         13      > JMPZ                                                     ~12, ->15
         14    >   ASSIGN_OP                                     8          !1, '+UNION+'
   15    15    >   ROPE_INIT                                     3  ~15     '%28SELECT+%60'
         16        ROPE_ADD                                      1  ~15     ~15, !3
         17        ROPE_END                                      2  ~14     ~15, '%60%2C+%60pt_last_name%60%2C+%60pt_first_name%60%2C+%60start_date%60%2C+%22'
         18        CONCAT                                           ~17     ~14, !2
         19        CONCAT                                           ~18     ~17, '%22+AS+%60table%60+FROM+%60'
         20        CONCAT                                           ~19     ~18, !2
         21        CONCAT                                           ~20     ~19, '%60%29'
         22        ASSIGN_OP                                     8          !1, ~20
   11    23      > JMP                                                      ->3
         24    >   FE_FREE                                                  $6
   17    25        ROPE_INIT                                     3  ~23     '+ORDER+BY+STR_TO_DATE%28%60start_date%60%2C+%27%25m%2F%25d%2F%25Y%27%29+DESC%2C+%60'
         26        ROPE_ADD                                      1  ~23     ~23, !3
         27        ROPE_END                                      2  ~22     ~23, '%60+DESC+LIMIT+0%2C100'
         28        ASSIGN_OP                                     8          !1, ~22
   19    29        ECHO                                                     !1
         30      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.97 ms | 1395 KiB | 13 Q