3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getGoogleSuggestions($query){ $file = file_get_contents("https://www.google.com/search?q=".urlencode($query)); $ex0 = explode('Did you mean:', $file); $ex2 = explode("</i></b>", $ex0[1]); $ex3 = explode("class=p>",$ex2[0]); $ex4 = str_replace('<b><i>', '', $ex3[1]); return "Did you mean: ".$ex4; } $file = file_get_contents('http://www.goxal.com/words.txt'); $explodeit = explode(" ",$file); foreach($explodeit as $value) { $query = trim($value); echo $value. " - " .getGoogleSuggestions($query).'<br>'; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 23
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 23
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
filename:       /in/GfaKt
function name:  (null)
number of ops:  25
compiled vars:  !0 = $file, !1 = $explodeit, !2 = $value, !3 = $query
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL                                               'file_get_contents'
          1        SEND_VAL                                                 'http%3A%2F%2Fwww.goxal.com%2Fwords.txt'
          2        DO_ICALL                                         $4      
          3        ASSIGN                                                   !0, $4
   14     4        INIT_FCALL                                               'explode'
          5        SEND_VAL                                                 '%0A'
   15     6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $6      
   14     8        ASSIGN                                                   !1, $6
   17     9      > FE_RESET_R                                       $8      !1, ->23
         10    > > FE_FETCH_R                                               $8, !2, ->23
   18    11    >   INIT_FCALL                                               'trim'
         12        SEND_VAR                                                 !2
         13        DO_ICALL                                         $9      
         14        ASSIGN                                                   !3, $9
   19    15        CONCAT                                           ~11     !2, '+-+'
         16        INIT_FCALL                                               'getgooglesuggestions'
         17        SEND_VAR                                                 !3
         18        DO_FCALL                                      0  $12     
         19        CONCAT                                           ~13     ~11, $12
         20        CONCAT                                           ~14     ~13, '%3Cbr%3E'
         21        ECHO                                                     ~14
   17    22      > JMP                                                      ->10
         23    >   FE_FREE                                                  $8
   20    24      > RETURN                                                   1

Function getgooglesuggestions:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GfaKt
function name:  getGoogleSuggestions
number of ops:  36
compiled vars:  !0 = $query, !1 = $file, !2 = $ex0, !3 = $ex2, !4 = $ex3, !5 = $ex4
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        INIT_FCALL                                               'file_get_contents'
          2        INIT_FCALL                                               'urlencode'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $6      
          5        CONCAT                                           ~7      'https%3A%2F%2Fwww.google.com%2Fsearch%3Fq%3D', $6
          6        SEND_VAL                                                 ~7
          7        DO_ICALL                                         $8      
          8        ASSIGN                                                   !1, $8
    6     9        INIT_FCALL                                               'explode'
         10        SEND_VAL                                                 'Did+you+mean%3A'
         11        SEND_VAR                                                 !1
         12        DO_ICALL                                         $10     
         13        ASSIGN                                                   !2, $10
    7    14        INIT_FCALL                                               'explode'
         15        SEND_VAL                                                 '%3C%2Fi%3E%3C%2Fb%3E'
         16        FETCH_DIM_R                                      ~12     !2, 1
         17        SEND_VAL                                                 ~12
         18        DO_ICALL                                         $13     
         19        ASSIGN                                                   !3, $13
    8    20        INIT_FCALL                                               'explode'
         21        SEND_VAL                                                 'class%3Dp%3E'
         22        FETCH_DIM_R                                      ~15     !3, 0
         23        SEND_VAL                                                 ~15
         24        DO_ICALL                                         $16     
         25        ASSIGN                                                   !4, $16
    9    26        INIT_FCALL                                               'str_replace'
         27        SEND_VAL                                                 '%3Cb%3E%3Ci%3E'
         28        SEND_VAL                                                 ''
         29        FETCH_DIM_R                                      ~18     !4, 1
         30        SEND_VAL                                                 ~18
         31        DO_ICALL                                         $19     
         32        ASSIGN                                                   !5, $19
   10    33        CONCAT                                           ~21     'Did+you+mean%3A+', !5
         34      > RETURN                                                   ~21
   11    35*     > RETURN                                                   null

End of function getgooglesuggestions

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.73 ms | 1403 KiB | 24 Q