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 = 43) Position 1 = 3, Position 2 = 7
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 12
Branch analysis from position: 9
2 jumps found. (Code = 77) Position 1 = 14, Position 2 = 35
Branch analysis from position: 14
2 jumps found. (Code = 78) Position 1 = 15, Position 2 = 35
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 25, Position 2 = 26
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 26
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 35
Branch analysis from position: 12
Branch analysis from position: 7
filename:       /in/BppXM
function name:  (null)
number of ops:  42
compiled vars:  !0 = $table_arr, !1 = $id_arr, !2 = $query, !3 = $table, !4 = $idfield
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    6     1        ISSET_ISEMPTY_CV                                         !0
          2      > JMPZ                                                     ~6, ->7
          3    >   FETCH_THIS                                       $8      
          4        FETCH_OBJ_R                                      ~9      $8, 'table'
          5        ASSIGN_DIM                                               !0
          6        OP_DATA                                                  ~9
    9     7    >   ISSET_ISEMPTY_CV                                         !1
          8      > JMPZ                                                     ~10, ->12
          9    >   FETCH_THIS                                       $11     
         10        FETCH_OBJ_R                                      ~12     $11, 'id_arr'
         11        ASSIGN                                                   !1, ~12
   10    12    >   ASSIGN                                                   !2, ''
   11    13      > FE_RESET_R                                       $15     !0, ->35
         14    > > FE_FETCH_R                                               $15, !3, ->35
   13    15    >   FETCH_THIS                                       $16     
         16        INIT_METHOD_CALL                                         $16, 'getPriKey'
         17        SEND_VAR_EX                                              !3
         18        DO_FCALL                                      0  $17     
         19        ASSIGN                                                   !4, $17
   14    20        FETCH_THIS                                       $19     
         21        INIT_METHOD_CALL                                         $19, 'getTable'
         22        DO_FCALL                                      0  $20     
         23        IS_NOT_IDENTICAL                                         !3, $20
         24      > JMPZ                                                     ~21, ->26
         25    >   ASSIGN_OP                                     8          !2, '+UNION+'
   15    26    >   ROPE_INIT                                     3  ~24     '%28SELECT+%60'
         27        ROPE_ADD                                      1  ~24     ~24, !4
         28        ROPE_END                                      2  ~23     ~24, '%60%2C+%60pt_last_name%60%2C+%60pt_first_name%60%2C+%60start_date%60%2C+%22'
         29        CONCAT                                           ~26     ~23, !3
         30        CONCAT                                           ~27     ~26, '%22+AS+%60table%60+FROM+%60'
         31        CONCAT                                           ~28     ~27, !3
         32        CONCAT                                           ~29     ~28, '%60%29'
         33        ASSIGN_OP                                     8          !2, ~29
   11    34      > JMP                                                      ->14
         35    >   FE_FREE                                                  $15
   17    36        ROPE_INIT                                     3  ~32     '+ORDER+BY+STR_TO_DATE%28%60start_date%60%2C+%27%25m%2F%25d%2F%25Y%27%29+DESC%2C+%60'
         37        ROPE_ADD                                      1  ~32     ~32, !4
         38        ROPE_END                                      2  ~31     ~32, '%60+DESC+LIMIT+0%2C100'
         39        ASSIGN_OP                                     8          !2, ~31
   19    40        ECHO                                                     !2
         41      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.97 ms | 1399 KiB | 13 Q