3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = "What do you carry in your purse/wallet?"; $numbertoscan = 5; $query = str_replace(' ', '%20', $input); $i=0; while($i<$numbertoscan){ $url = "http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=".$query."&start=".$i*4; $body = file_get_contents($url); $json = json_decode($body); for($x=0;$x<count($json->responseData->results);$x++){ //echo "<b>Result ".($x+1)."</b>"; //echo "<br>URL: "; // $json->responseData->results[$x]->url; //echo "<br>VisibleURL: "; //echo $json->responseData->results[$x]->visibleUrl; //echo "<br>Title: "; //echo $json->responseData->results[$x]->title; //echo "<br>Content: "; if (strpos($json->responseData->results[$x]->content,' i ') !== false) { echo $json->responseData->results[$x]->content; echo "<br><br>"; } } $i++; } ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 48
Branch analysis from position: 48
2 jumps found. (Code = 44) Position 1 = 50, Position 2 = 10
Branch analysis from position: 50
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 42
Branch analysis from position: 42
2 jumps found. (Code = 44) Position 1 = 47, Position 2 = 25
Branch analysis from position: 47
2 jumps found. (Code = 44) Position 1 = 50, Position 2 = 10
Branch analysis from position: 50
Branch analysis from position: 10
Branch analysis from position: 25
2 jumps found. (Code = 43) Position 1 = 35, Position 2 = 41
Branch analysis from position: 35
2 jumps found. (Code = 44) Position 1 = 47, Position 2 = 25
Branch analysis from position: 47
Branch analysis from position: 25
Branch analysis from position: 41
filename:       /in/0BGsi
function name:  (null)
number of ops:  51
compiled vars:  !0 = $input, !1 = $numbertoscan, !2 = $query, !3 = $i, !4 = $url, !5 = $body, !6 = $json, !7 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'What+do+you+carry+in+your+purse%2Fwallet%3F'
    4     1        ASSIGN                                                   !1, 5
    5     2        INIT_FCALL                                               'str_replace'
          3        SEND_VAL                                                 '+'
          4        SEND_VAL                                                 '%2520'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $10     
          7        ASSIGN                                                   !2, $10
    6     8        ASSIGN                                                   !3, 0
    7     9      > JMP                                                      ->48
    8    10    >   CONCAT                                           ~13     'http%3A%2F%2Fajax.googleapis.com%2Fajax%2Fservices%2Fsearch%2Fweb%3Fv%3D1.0%26q%3D', !2
         11        CONCAT                                           ~14     ~13, '%26start%3D'
         12        MUL                                              ~15     !3, 4
         13        CONCAT                                           ~16     ~14, ~15
         14        ASSIGN                                                   !4, ~16
    9    15        INIT_FCALL                                               'file_get_contents'
         16        SEND_VAR                                                 !4
         17        DO_ICALL                                         $18     
         18        ASSIGN                                                   !5, $18
   10    19        INIT_FCALL                                               'json_decode'
         20        SEND_VAR                                                 !5
         21        DO_ICALL                                         $20     
         22        ASSIGN                                                   !6, $20
   11    23        ASSIGN                                                   !7, 0
         24      > JMP                                                      ->42
   20    25    >   INIT_FCALL                                               'strpos'
         26        FETCH_OBJ_R                                      ~23     !6, 'responseData'
         27        FETCH_OBJ_R                                      ~24     ~23, 'results'
         28        FETCH_DIM_R                                      ~25     ~24, !7
         29        FETCH_OBJ_R                                      ~26     ~25, 'content'
         30        SEND_VAL                                                 ~26
         31        SEND_VAL                                                 '+i+'
         32        DO_ICALL                                         $27     
         33        TYPE_CHECK                                  1018          $27
         34      > JMPZ                                                     ~28, ->41
   21    35    >   FETCH_OBJ_R                                      ~29     !6, 'responseData'
         36        FETCH_OBJ_R                                      ~30     ~29, 'results'
         37        FETCH_DIM_R                                      ~31     ~30, !7
         38        FETCH_OBJ_R                                      ~32     ~31, 'content'
         39        ECHO                                                     ~32
   22    40        ECHO                                                     '%3Cbr%3E%3Cbr%3E'
   11    41    >   PRE_INC                                                  !7
         42    >   FETCH_OBJ_R                                      ~34     !6, 'responseData'
         43        FETCH_OBJ_R                                      ~35     ~34, 'results'
         44        COUNT                                            ~36     ~35
         45        IS_SMALLER                                               !7, ~36
         46      > JMPNZ                                                    ~37, ->25
   26    47    >   PRE_INC                                                  !3
    7    48    >   IS_SMALLER                                               !3, !1
         49      > JMPNZ                                                    ~39, ->10
   28    50    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.56 ms | 1400 KiB | 21 Q