3v4l.org

run code in 300+ PHP versions simultaneously
<?php require_once('config.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 = 16, Position 2 = 22
Branch analysis from position: 16
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
2 jumps found. (Code = 43) Position 1 = 33, Position 2 = 36
Branch analysis from position: 33
2 jumps found. (Code = 43) Position 1 = 50, Position 2 = 56
Branch analysis from position: 50
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 56
1 jumps found. (Code = 42) Position 1 = 82
Branch analysis from position: 82
2 jumps found. (Code = 44) Position 1 = 87, Position 2 = 58
Branch analysis from position: 87
1 jumps found. (Code = 42) Position 1 = 93
Branch analysis from position: 93
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 58
2 jumps found. (Code = 43) Position 1 = 60, Position 2 = 72
Branch analysis from position: 60
2 jumps found. (Code = 77) Position 1 = 62, Position 2 = 69
Branch analysis from position: 62
2 jumps found. (Code = 78) Position 1 = 63, Position 2 = 69
Branch analysis from position: 63
1 jumps found. (Code = 42) Position 1 = 62
Branch analysis from position: 62
Branch analysis from position: 69
2 jumps found. (Code = 77) Position 1 = 74, Position 2 = 80
Branch analysis from position: 74
2 jumps found. (Code = 78) Position 1 = 75, Position 2 = 80
Branch analysis from position: 75
1 jumps found. (Code = 42) Position 1 = 74
Branch analysis from position: 74
Branch analysis from position: 80
2 jumps found. (Code = 44) Position 1 = 87, Position 2 = 58
Branch analysis from position: 87
Branch analysis from position: 58
Branch analysis from position: 80
Branch analysis from position: 69
Branch analysis from position: 72
Branch analysis from position: 36
Found catch point at position: 27
Branch analysis from position: 27
2 jumps found. (Code = 107) Position 1 = 28, Position 2 = -2
Branch analysis from position: 28
2 jumps found. (Code = 43) Position 1 = 33, Position 2 = 36
Branch analysis from position: 33
Branch analysis from position: 36
Found catch point at position: 89
Branch analysis from position: 89
2 jumps found. (Code = 107) Position 1 = 90, Position 2 = -2
Branch analysis from position: 90
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/p4YWR
function name:  (null)
number of ops:  100
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 >   INCLUDE_OR_EVAL                                          'config.php', REQUIRE_ONCE
    3     1        ASSIGN                                                   !0, 'ILRL'
    5     2        FETCH_R                      global              ~12     '_GET'
          3        FETCH_DIM_R                                      ~13     ~12, 'wo'
          4        ASSIGN                                                   !1, ~13
    8     5        INIT_METHOD_CALL                                         !3, 'prepare'
          6        ROPE_INIT                                     3  ~16     'SELECT+DISTINCT+workorder+FROM+'
          7        ROPE_ADD                                      1  ~16     ~16, !0
          8        ROPE_END                                      2  ~15     ~16, '+Order+By+date_time+DESC+LIMIT+20'
          9        SEND_VAL_EX                                              ~15
         10        DO_FCALL                                      0  $18     
         11        ASSIGN                                                   !2, $18
   10    12        INIT_METHOD_CALL                                         !2, 'execute'
         13        DO_FCALL                                      0  $20     
         14        BOOL_NOT                                         ~21     $20
         15      > JMPZ                                                     ~21, ->22
   11    16    >   INIT_FCALL                                               'print_r'
         17        INIT_METHOD_CALL                                         !3, 'errorInfo'
         18        DO_FCALL                                      0  $22     
         19        SEND_VAR                                                 $22
         20        DO_ICALL                                         $23     
         21      > EXIT                                                     $23
   13    22    >   INIT_METHOD_CALL                                         !2, 'fetchAll'
         23        SEND_VAL_EX                                              5
         24        DO_FCALL                                      0  $24     
         25        ASSIGN                                                   !4, $24
         26      > JMP                                                      ->31
   14    27  E > > CATCH                                       last         'Exception'
         28    >   INIT_METHOD_CALL                                         !5, 'getMessage'
         29        DO_FCALL                                      0  $26     
         30        ECHO                                                     $26
   17    31    >   ISSET_ISEMPTY_CV                                         !1
         32      > JMPZ                                                     ~27, ->36
   18    33    >   FETCH_DIM_R                                      ~28     !4, 0
         34        FETCH_OBJ_R                                      ~29     ~28, 'workorder'
         35        ASSIGN                                                   !1, ~29
   19    36    >   ASSIGN                                                   !6, <false>
   20    37        INIT_METHOD_CALL                                         !3, 'prepare'
         38        ROPE_INIT                                     5  ~33     'SELECT+%2A+FROM+'
         39        ROPE_ADD                                      1  ~33     ~33, !0
         40        ROPE_ADD                                      2  ~33     ~33, '+WHERE+workorder%3D'
         41        ROPE_ADD                                      3  ~33     ~33, !1
         42        ROPE_END                                      4  ~32     ~33, '+ORDER+BY+date_time+DESC+LIMIT+1000'
         43        SEND_VAL_EX                                              ~32
         44        DO_FCALL                                      0  $36     
         45        ASSIGN                                                   !2, $36
   22    46        INIT_METHOD_CALL                                         !2, 'execute'
         47        DO_FCALL                                      0  $38     
         48        BOOL_NOT                                         ~39     $38
         49      > JMPZ                                                     ~39, ->56
   23    50    >   INIT_FCALL                                               'print_r'
         51        INIT_METHOD_CALL                                         !3, 'errorInfo'
         52        DO_FCALL                                      0  $40     
         53        SEND_VAR                                                 $40
         54        DO_ICALL                                         $41     
         55      > EXIT                                                     $41
   25    56    >   ECHO                                                     '%3Ctable+class%3D%27striped+responsive-table%27%3E'
   27    57      > JMP                                                      ->82
   29    58    >   BOOL_NOT                                         ~42     !6
         59      > JMPZ                                                     ~42, ->72
   30    60    >   ECHO                                                     '%3Cthead%3E%3Ctr%3E'
   31    61      > FE_RESET_R                                       $43     !7, ->69
         62    > > FE_FETCH_R                                       ~44     $43, !8, ->69
         63    >   ASSIGN                                                   !9, ~44
   32    64        ROPE_INIT                                     3  ~47     '%3Cth%3E'
         65        ROPE_ADD                                      1  ~47     ~47, !9
         66        ROPE_END                                      2  ~46     ~47, '%3C%2Fth%3E'
         67        ECHO                                                     ~46
   31    68      > JMP                                                      ->62
         69    >   FE_FREE                                                  $43
   34    70        ECHO                                                     '%3C%2Ftr%3E%3C%2Fthead%3E%3Ctbody%3E'
   35    71        ASSIGN                                                   !6, <true>
   37    72    >   ECHO                                                     '%3Ctr%3E'
   38    73      > FE_RESET_R                                       $50     !7, ->80
         74    > > FE_FETCH_R                                               $50, !8, ->80
   39    75    >   ROPE_INIT                                     3  ~52     '%3Ctd%3E'
         76        ROPE_ADD                                      1  ~52     ~52, !8
         77        ROPE_END                                      2  ~51     ~52, '%3C%2Ftd%3E'
         78        ECHO                                                     ~51
   38    79      > JMP                                                      ->74
         80    >   FE_FREE                                                  $50
   41    81        ECHO                                                     '%3C%2Ftr%3E'
   27    82    >   INIT_METHOD_CALL                                         !2, 'fetch'
         83        SEND_VAL_EX                                              2
         84        DO_FCALL                                      0  $54     
         85        ASSIGN                                           ~55     !7, $54
         86      > JMPNZ                                                    ~55, ->58
   43    87    >   ECHO                                                     '%3C%2Ftbody%3E%3C%2Ftable%3E'
         88      > JMP                                                      ->93
   44    89  E > > CATCH                                       last         'Exception'
         90    >   INIT_METHOD_CALL                                         !5, 'getMessage'
         91        DO_FCALL                                      0  $56     
         92        ECHO                                                     $56
   46    93    >   ECHO                                                     '%0A%3Cscript+type%3D%22text%2Fjavascript%22%3E%0A++++var+woListFromSQL+%3D+'
   48    94        INIT_FCALL                                               'json_encode'
         95        SEND_VAR                                                 !4
         96        DO_ICALL                                         $57     
         97        ECHO                                                     $57
         98        ECHO                                                     '%3B%0A%3C%2Fscript%3E'
   49    99      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.81 ms | 1404 KiB | 17 Q