3v4l.org

run code in 300+ PHP versions simultaneously
<?php # build the API URL to call $params = array( 'api_key'=> "fd3fabe4e9d94ca725df1de71b8d285b", 'method'=> "flickr.photos.search", 'tags'=> "torre de belem", 'format'=> "json", ); $encoded_params = array(); foreach ($params as $k => $v){ $encoded_params[] = urlencode($k).'='.urlencode($v); } # call the API and decode the response $url = "http://api.flickr.com/services/rest/?".implode('&', $encoded_params); print_r($url); $rsp = file_get_contents($url); $rsp_obj = unserialize($rsp); # display the photo title (or an error if it failed) if ($rsp_obj['stat'] == 'ok'){ $photo_title = $rsp_obj['photo']['title']['_content']; echo "Title is $photo_title!"; }else{ echo "Call failed!"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 16
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 16
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 37, Position 2 = 46
Branch analysis from position: 37
1 jumps found. (Code = 42) Position 1 = 47
Branch analysis from position: 47
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 46
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/pHilr
function name:  (null)
number of ops:  48
compiled vars:  !0 = $params, !1 = $encoded_params, !2 = $v, !3 = $k, !4 = $url, !5 = $rsp, !6 = $rsp_obj, !7 = $photo_title
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, <array>
   13     1        ASSIGN                                                   !1, <array>
   14     2      > FE_RESET_R                                       $10     !0, ->16
          3    > > FE_FETCH_R                                       ~11     $10, !2, ->16
          4    >   ASSIGN                                                   !3, ~11
   15     5        INIT_FCALL                                               'urlencode'
          6        SEND_VAR                                                 !3
          7        DO_ICALL                                         $14     
          8        CONCAT                                           ~15     $14, '%3D'
          9        INIT_FCALL                                               'urlencode'
         10        SEND_VAR                                                 !2
         11        DO_ICALL                                         $16     
         12        CONCAT                                           ~17     ~15, $16
         13        ASSIGN_DIM                                               !1
         14        OP_DATA                                                  ~17
   14    15      > JMP                                                      ->3
         16    >   FE_FREE                                                  $10
   19    17        INIT_FCALL                                               'implode'
         18        SEND_VAL                                                 '%26'
         19        SEND_VAR                                                 !1
         20        DO_ICALL                                         $18     
         21        CONCAT                                           ~19     'http%3A%2F%2Fapi.flickr.com%2Fservices%2Frest%2F%3F', $18
         22        ASSIGN                                                   !4, ~19
   21    23        INIT_FCALL                                               'print_r'
         24        SEND_VAR                                                 !4
         25        DO_ICALL                                                 
   23    26        INIT_FCALL                                               'file_get_contents'
         27        SEND_VAR                                                 !4
         28        DO_ICALL                                         $22     
         29        ASSIGN                                                   !5, $22
   24    30        INIT_FCALL                                               'unserialize'
         31        SEND_VAR                                                 !5
         32        DO_ICALL                                         $24     
         33        ASSIGN                                                   !6, $24
   27    34        FETCH_DIM_R                                      ~26     !6, 'stat'
         35        IS_EQUAL                                                 ~26, 'ok'
         36      > JMPZ                                                     ~27, ->46
   28    37    >   FETCH_DIM_R                                      ~28     !6, 'photo'
         38        FETCH_DIM_R                                      ~29     ~28, 'title'
         39        FETCH_DIM_R                                      ~30     ~29, '_content'
         40        ASSIGN                                                   !7, ~30
   29    41        ROPE_INIT                                     3  ~33     'Title+is+'
         42        ROPE_ADD                                      1  ~33     ~33, !7
         43        ROPE_END                                      2  ~32     ~33, '%21'
         44        ECHO                                                     ~32
         45      > JMP                                                      ->47
   31    46    >   ECHO                                                     'Call+failed%21'
   32    47    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.68 ms | 1400 KiB | 23 Q