3v4l.org

run code in 300+ PHP versions simultaneously
<?php // include the tmdb class include('tmdb.php'); //if you prefer using 'xml' $tmdb_xml = new TMDb('YOUR_API_KEY_HERE', TMDb::XML); //Title to search for $title = $_POST['title']; //Search Movie with default return format $xml_movies_result = $tmdb_xml->searchMovie($title); $xml = simplexml_load_string($xml_movies_result); echo '<table>'; echo '<tr>'; echo '<th>Cover</th>'; echo '<th>Info</th>'; echo '</tr>'; foreach ($xml->movies->movie as $movie) { $moviename = $movie->name; $imdbid = $movie->imdb_id; $posterimg = $movie->images->image[3]['url']; echo '<tr>'; if (!empty($posterimg)) { echo '<td><a target="_blank" href="'.$movie->url.'"></a></td>'; } else { echo '<td>No image</td>'; } echo '<td><a target="_blank" href="'.$movie->url.'"><strong>'.$moviename.'</strong></a> ('.substr($movie->released, 0, 4).')<br /><br />'; echo $movie->overview; echo '</td>'; echo '</tr>'; } echo '</table>'; ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 26, Position 2 = 65
Branch analysis from position: 26
2 jumps found. (Code = 78) Position 1 = 27, Position 2 = 65
Branch analysis from position: 27
2 jumps found. (Code = 43) Position 1 = 40, Position 2 = 45
Branch analysis from position: 40
1 jumps found. (Code = 42) Position 1 = 46
Branch analysis from position: 46
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
Branch analysis from position: 45
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
Branch analysis from position: 65
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 65
filename:       /in/qvEHS
function name:  (null)
number of ops:  68
compiled vars:  !0 = $tmdb_xml, !1 = $title, !2 = $xml_movies_result, !3 = $xml, !4 = $movie, !5 = $moviename, !6 = $imdbid, !7 = $posterimg
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INCLUDE_OR_EVAL                                          'tmdb.php', INCLUDE
    7     1        NEW                                              $9      'TMDb'
          2        SEND_VAL_EX                                              'YOUR_API_KEY_HERE'
          3        FETCH_CLASS_CONSTANT                             ~10     'TMDb', 'XML'
          4        SEND_VAL_EX                                              ~10
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !0, $9
   11     7        FETCH_R                      global              ~13     '_POST'
          8        FETCH_DIM_R                                      ~14     ~13, 'title'
          9        ASSIGN                                                   !1, ~14
   14    10        INIT_METHOD_CALL                                         !0, 'searchMovie'
         11        SEND_VAR_EX                                              !1
         12        DO_FCALL                                      0  $16     
         13        ASSIGN                                                   !2, $16
   16    14        INIT_FCALL                                               'simplexml_load_string'
         15        SEND_VAR                                                 !2
         16        DO_ICALL                                         $18     
         17        ASSIGN                                                   !3, $18
   18    18        ECHO                                                     '%3Ctable%3E'
   19    19        ECHO                                                     '%3Ctr%3E'
   20    20        ECHO                                                     '%3Cth%3ECover%3C%2Fth%3E'
   21    21        ECHO                                                     '%3Cth%3EInfo%3C%2Fth%3E'
   22    22        ECHO                                                     '%3C%2Ftr%3E'
   23    23        FETCH_OBJ_R                                      ~20     !3, 'movies'
         24        FETCH_OBJ_R                                      ~21     ~20, 'movie'
         25      > FE_RESET_R                                       $22     ~21, ->65
         26    > > FE_FETCH_R                                               $22, !4, ->65
   24    27    >   FETCH_OBJ_R                                      ~23     !4, 'name'
         28        ASSIGN                                                   !5, ~23
   25    29        FETCH_OBJ_R                                      ~25     !4, 'imdb_id'
         30        ASSIGN                                                   !6, ~25
   26    31        FETCH_OBJ_R                                      ~27     !4, 'images'
         32        FETCH_OBJ_R                                      ~28     ~27, 'image'
         33        FETCH_DIM_R                                      ~29     ~28, 3
         34        FETCH_DIM_R                                      ~30     ~29, 'url'
         35        ASSIGN                                                   !7, ~30
   29    36        ECHO                                                     '%3Ctr%3E'
   30    37        ISSET_ISEMPTY_CV                                 ~32     !7
         38        BOOL_NOT                                         ~33     ~32
         39      > JMPZ                                                     ~33, ->45
   31    40    >   FETCH_OBJ_R                                      ~34     !4, 'url'
         41        CONCAT                                           ~35     '%3Ctd%3E%3Ca+target%3D%22_blank%22+href%3D%22', ~34
         42        CONCAT                                           ~36     ~35, '%22%3E%3C%2Fa%3E%3C%2Ftd%3E'
         43        ECHO                                                     ~36
         44      > JMP                                                      ->46
   33    45    >   ECHO                                                     '%3Ctd%3ENo+image%3C%2Ftd%3E'
   35    46    >   FETCH_OBJ_R                                      ~37     !4, 'url'
         47        CONCAT                                           ~38     '%3Ctd%3E%3Ca+target%3D%22_blank%22+href%3D%22', ~37
         48        CONCAT                                           ~39     ~38, '%22%3E%3Cstrong%3E'
         49        CONCAT                                           ~40     ~39, !5
         50        CONCAT                                           ~41     ~40, '%3C%2Fstrong%3E%3C%2Fa%3E+%28'
         51        INIT_FCALL                                               'substr'
         52        FETCH_OBJ_R                                      ~42     !4, 'released'
         53        SEND_VAL                                                 ~42
         54        SEND_VAL                                                 0
         55        SEND_VAL                                                 4
         56        DO_ICALL                                         $43     
         57        CONCAT                                           ~44     ~41, $43
         58        CONCAT                                           ~45     ~44, '%29%3Cbr+%2F%3E%3Cbr+%2F%3E'
         59        ECHO                                                     ~45
   36    60        FETCH_OBJ_R                                      ~46     !4, 'overview'
         61        ECHO                                                     ~46
   37    62        ECHO                                                     '%3C%2Ftd%3E'
   38    63        ECHO                                                     '%3C%2Ftr%3E'
   23    64      > JMP                                                      ->26
         65    >   FE_FREE                                                  $22
   40    66        ECHO                                                     '%3C%2Ftable%3E'
   41    67      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.38 ms | 1400 KiB | 17 Q