3v4l.org

run code in 300+ PHP versions simultaneously
<?php function callInstagram($url) { $ch = curl_init(); curl_setopt_array($ch, array( CURLOPT_URL => $url, CURLOPT_RETURNTRANSFER => true, CURLOPT_SSL_VERIFYPEER => false, CURLOPT_SSL_VERIFYHOST => 2 )); $result = curl_exec($ch); curl_close($ch); return $result; } $tag = 'instabeachpro'; $client_id = "XXXXXXXXXXXXXXXXXXXXX"; $url = 'https://api.instagram.com/v1/tags/'.$tag.'/media/recent?client_id='.$client_id; $inst_stream = callInstagram($url); $results = json_decode($inst_stream, true); //Now parse through the $results array to display your results... foreach($results['data'] as $item){ $image_link = $item['images']['low_resolution']['url']; echo '<img src="'.$image_link.'" />'; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 17, Position 2 = 26
Branch analysis from position: 17
2 jumps found. (Code = 78) Position 1 = 18, Position 2 = 26
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
filename:       /in/ocdD8
function name:  (null)
number of ops:  28
compiled vars:  !0 = $tag, !1 = $client_id, !2 = $url, !3 = $inst_stream, !4 = $results, !5 = $item, !6 = $image_link
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   ASSIGN                                                   !0, 'instabeachpro'
   17     1        ASSIGN                                                   !1, 'XXXXXXXXXXXXXXXXXXXXX'
   19     2        CONCAT                                           ~9      'https%3A%2F%2Fapi.instagram.com%2Fv1%2Ftags%2F', !0
          3        CONCAT                                           ~10     ~9, '%2Fmedia%2Frecent%3Fclient_id%3D'
          4        CONCAT                                           ~11     ~10, !1
          5        ASSIGN                                                   !2, ~11
   22     6        INIT_FCALL                                               'callinstagram'
          7        SEND_VAR                                                 !2
          8        DO_FCALL                                      0  $13     
          9        ASSIGN                                                   !3, $13
   23    10        INIT_FCALL                                               'json_decode'
         11        SEND_VAR                                                 !3
         12        SEND_VAL                                                 <true>
         13        DO_ICALL                                         $15     
         14        ASSIGN                                                   !4, $15
   26    15        FETCH_DIM_R                                      ~17     !4, 'data'
         16      > FE_RESET_R                                       $18     ~17, ->26
         17    > > FE_FETCH_R                                               $18, !5, ->26
   27    18    >   FETCH_DIM_R                                      ~19     !5, 'images'
         19        FETCH_DIM_R                                      ~20     ~19, 'low_resolution'
         20        FETCH_DIM_R                                      ~21     ~20, 'url'
         21        ASSIGN                                                   !6, ~21
   28    22        CONCAT                                           ~23     '%3Cimg+src%3D%22', !6
         23        CONCAT                                           ~24     ~23, '%22+%2F%3E'
         24        ECHO                                                     ~24
   26    25      > JMP                                                      ->17
         26    >   FE_FREE                                                  $18
   29    27      > RETURN                                                   1

Function callinstagram:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ocdD8
function name:  callInstagram
number of ops:  25
compiled vars:  !0 = $url, !1 = $ch, !2 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    4     1        INIT_FCALL_BY_NAME                                       'curl_init'
          2        DO_FCALL                                      0  $3      
          3        ASSIGN                                                   !1, $3
    5     4        INIT_FCALL_BY_NAME                                       'curl_setopt_array'
          5        SEND_VAR_EX                                              !1
    6     6        FETCH_CONSTANT                                   ~5      'CURLOPT_URL'
          7        INIT_ARRAY                                       ~6      !0, ~5
    7     8        FETCH_CONSTANT                                   ~7      'CURLOPT_RETURNTRANSFER'
    6     9        ADD_ARRAY_ELEMENT                                ~6      <true>, ~7
    8    10        FETCH_CONSTANT                                   ~8      'CURLOPT_SSL_VERIFYPEER'
    6    11        ADD_ARRAY_ELEMENT                                ~6      <false>, ~8
    9    12        FETCH_CONSTANT                                   ~9      'CURLOPT_SSL_VERIFYHOST'
         13        ADD_ARRAY_ELEMENT                                ~6      2, ~9
         14        SEND_VAL_EX                                              ~6
         15        DO_FCALL                                      0          
   12    16        INIT_FCALL_BY_NAME                                       'curl_exec'
         17        SEND_VAR_EX                                              !1
         18        DO_FCALL                                      0  $11     
         19        ASSIGN                                                   !2, $11
   13    20        INIT_FCALL_BY_NAME                                       'curl_close'
         21        SEND_VAR_EX                                              !1
         22        DO_FCALL                                      0          
   14    23      > RETURN                                                   !2
   15    24*     > RETURN                                                   null

End of function callinstagram

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.44 ms | 1403 KiB | 16 Q