3v4l.org

run code in 300+ PHP versions simultaneously
<?php $table = 'ILRL'; $requestedWO = $_GET['wo']; // Grab last 20 workorders $query = $bd->prepare("SELECT DISTINCT workorder FROM $table Order By date_time DESC LIMIT 20"); try { if(!$query->execute()) die(print_r($bd->errorInfo())); $woList = $query->fetchAll(PDO::FETCH_OBJ); } catch (Exception $e) { echo $e->getMessage(); } // wo results if( empty($requestedWO) ) $requestedWO = $woList[0]->workorder; $tableheader = false; $query = $bd->prepare("SELECT * FROM $table WHERE workorder=$requestedWO ORDER BY date_time DESC LIMIT 1000"); try { if(!$query->execute()) die(print_r($bd->errorInfo())); echo "<table class='striped responsive-table'>"; while($row = $query->fetch(PDO::FETCH_ASSOC)) { if($tableheader == false) { echo '<thead><tr>'; foreach($row as $key=>$value) { echo "<th>{$key}</th>"; } echo '</tr></thead><tbody>'; $tableheader = true; } echo "<tr>"; foreach($row as $value) { echo "<td>{$value}</td>"; } echo "</tr>"; } echo "</tbody></table>"; } catch (Exception $e) { echo $e->getMessage(); } ?> <script type="text/javascript"> var woListFromSQL = <?php print(json_encode($woList)); ?>; </script>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 21
Branch analysis from position: 15
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
2 jumps found. (Code = 43) Position 1 = 32, Position 2 = 35
Branch analysis from position: 32
2 jumps found. (Code = 43) Position 1 = 49, Position 2 = 55
Branch analysis from position: 49
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 55
1 jumps found. (Code = 42) Position 1 = 81
Branch analysis from position: 81
2 jumps found. (Code = 44) Position 1 = 86, Position 2 = 57
Branch analysis from position: 86
1 jumps found. (Code = 42) Position 1 = 92
Branch analysis from position: 92
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 57
2 jumps found. (Code = 43) Position 1 = 59, Position 2 = 71
Branch analysis from position: 59
2 jumps found. (Code = 77) Position 1 = 61, Position 2 = 68
Branch analysis from position: 61
2 jumps found. (Code = 78) Position 1 = 62, Position 2 = 68
Branch analysis from position: 62
1 jumps found. (Code = 42) Position 1 = 61
Branch analysis from position: 61
Branch analysis from position: 68
2 jumps found. (Code = 77) Position 1 = 73, Position 2 = 79
Branch analysis from position: 73
2 jumps found. (Code = 78) Position 1 = 74, Position 2 = 79
Branch analysis from position: 74
1 jumps found. (Code = 42) Position 1 = 73
Branch analysis from position: 73
Branch analysis from position: 79
2 jumps found. (Code = 44) Position 1 = 86, Position 2 = 57
Branch analysis from position: 86
Branch analysis from position: 57
Branch analysis from position: 79
Branch analysis from position: 68
Branch analysis from position: 71
Branch analysis from position: 35
Found catch point at position: 26
Branch analysis from position: 26
2 jumps found. (Code = 107) Position 1 = 27, Position 2 = -2
Branch analysis from position: 27
2 jumps found. (Code = 43) Position 1 = 32, Position 2 = 35
Branch analysis from position: 32
Branch analysis from position: 35
Found catch point at position: 88
Branch analysis from position: 88
2 jumps found. (Code = 107) Position 1 = 89, Position 2 = -2
Branch analysis from position: 89
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bkp2O
function name:  (null)
number of ops:  99
compiled vars:  !0 = $table, !1 = $requestedWO, !2 = $query, !3 = $bd, !4 = $woList, !5 = $e, !6 = $tableheader, !7 = $row, !8 = $value, !9 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'ILRL'
    4     1        FETCH_R                      global              ~11     '_GET'
          2        FETCH_DIM_R                                      ~12     ~11, 'wo'
          3        ASSIGN                                                   !1, ~12
    7     4        INIT_METHOD_CALL                                         !3, 'prepare'
          5        ROPE_INIT                                     3  ~15     'SELECT+DISTINCT+workorder+FROM+'
          6        ROPE_ADD                                      1  ~15     ~15, !0
          7        ROPE_END                                      2  ~14     ~15, '+Order+By+date_time+DESC+LIMIT+20'
          8        SEND_VAL_EX                                              ~14
          9        DO_FCALL                                      0  $17     
         10        ASSIGN                                                   !2, $17
    9    11        INIT_METHOD_CALL                                         !2, 'execute'
         12        DO_FCALL                                      0  $19     
         13        BOOL_NOT                                         ~20     $19
         14      > JMPZ                                                     ~20, ->21
   10    15    >   INIT_FCALL                                               'print_r'
         16        INIT_METHOD_CALL                                         !3, 'errorInfo'
         17        DO_FCALL                                      0  $21     
         18        SEND_VAR                                                 $21
         19        DO_ICALL                                         $22     
         20      > EXIT                                                     $22
   12    21    >   INIT_METHOD_CALL                                         !2, 'fetchAll'
         22        SEND_VAL_EX                                              5
         23        DO_FCALL                                      0  $23     
         24        ASSIGN                                                   !4, $23
         25      > JMP                                                      ->30
   13    26  E > > CATCH                                       last         'Exception'
         27    >   INIT_METHOD_CALL                                         !5, 'getMessage'
         28        DO_FCALL                                      0  $25     
         29        ECHO                                                     $25
   16    30    >   ISSET_ISEMPTY_CV                                         !1
         31      > JMPZ                                                     ~26, ->35
   17    32    >   FETCH_DIM_R                                      ~27     !4, 0
         33        FETCH_OBJ_R                                      ~28     ~27, 'workorder'
         34        ASSIGN                                                   !1, ~28
   18    35    >   ASSIGN                                                   !6, <false>
   19    36        INIT_METHOD_CALL                                         !3, 'prepare'
         37        ROPE_INIT                                     5  ~32     'SELECT+%2A+FROM+'
         38        ROPE_ADD                                      1  ~32     ~32, !0
         39        ROPE_ADD                                      2  ~32     ~32, '+WHERE+workorder%3D'
         40        ROPE_ADD                                      3  ~32     ~32, !1
         41        ROPE_END                                      4  ~31     ~32, '+ORDER+BY+date_time+DESC+LIMIT+1000'
         42        SEND_VAL_EX                                              ~31
         43        DO_FCALL                                      0  $35     
         44        ASSIGN                                                   !2, $35
   21    45        INIT_METHOD_CALL                                         !2, 'execute'
         46        DO_FCALL                                      0  $37     
         47        BOOL_NOT                                         ~38     $37
         48      > JMPZ                                                     ~38, ->55
   22    49    >   INIT_FCALL                                               'print_r'
         50        INIT_METHOD_CALL                                         !3, 'errorInfo'
         51        DO_FCALL                                      0  $39     
         52        SEND_VAR                                                 $39
         53        DO_ICALL                                         $40     
         54      > EXIT                                                     $40
   24    55    >   ECHO                                                     '%3Ctable+class%3D%27striped+responsive-table%27%3E'
   26    56      > JMP                                                      ->81
   28    57    >   BOOL_NOT                                         ~41     !6
         58      > JMPZ                                                     ~41, ->71
   29    59    >   ECHO                                                     '%3Cthead%3E%3Ctr%3E'
   30    60      > FE_RESET_R                                       $42     !7, ->68
         61    > > FE_FETCH_R                                       ~43     $42, !8, ->68
         62    >   ASSIGN                                                   !9, ~43
   31    63        ROPE_INIT                                     3  ~46     '%3Cth%3E'
         64        ROPE_ADD                                      1  ~46     ~46, !9
         65        ROPE_END                                      2  ~45     ~46, '%3C%2Fth%3E'
         66        ECHO                                                     ~45
   30    67      > JMP                                                      ->61
         68    >   FE_FREE                                                  $42
   33    69        ECHO                                                     '%3C%2Ftr%3E%3C%2Fthead%3E%3Ctbody%3E'
   34    70        ASSIGN                                                   !6, <true>
   36    71    >   ECHO                                                     '%3Ctr%3E'
   37    72      > FE_RESET_R                                       $49     !7, ->79
         73    > > FE_FETCH_R                                               $49, !8, ->79
   38    74    >   ROPE_INIT                                     3  ~51     '%3Ctd%3E'
         75        ROPE_ADD                                      1  ~51     ~51, !8
         76        ROPE_END                                      2  ~50     ~51, '%3C%2Ftd%3E'
         77        ECHO                                                     ~50
   37    78      > JMP                                                      ->73
         79    >   FE_FREE                                                  $49
   40    80        ECHO                                                     '%3C%2Ftr%3E'
   26    81    >   INIT_METHOD_CALL                                         !2, 'fetch'
         82        SEND_VAL_EX                                              2
         83        DO_FCALL                                      0  $53     
         84        ASSIGN                                           ~54     !7, $53
         85      > JMPNZ                                                    ~54, ->57
   42    86    >   ECHO                                                     '%3C%2Ftbody%3E%3C%2Ftable%3E'
         87      > JMP                                                      ->92
   43    88  E > > CATCH                                       last         'Exception'
         89    >   INIT_METHOD_CALL                                         !5, 'getMessage'
         90        DO_FCALL                                      0  $55     
         91        ECHO                                                     $55
   45    92    >   ECHO                                                     '%0A%3Cscript+type%3D%22text%2Fjavascript%22%3E%0A++++var+woListFromSQL+%3D+'
   47    93        INIT_FCALL                                               'json_encode'
         94        SEND_VAR                                                 !4
         95        DO_ICALL                                         $56     
         96        ECHO                                                     $56
         97        ECHO                                                     '%3B%0A%3C%2Fscript%3E'
   48    98      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.96 ms | 1408 KiB | 17 Q