3v4l.org

run code in 300+ PHP versions simultaneously
<?php $baseURI = 'https://api.twitter.com/1.1/search/tweets.json'; $method = 'GET'; $params = array('key1'=>'val1', 'key2'=>'val2'); print_r(process($baseURI, $method, $params)); function process($baseURI, $method, $params ){ $return = array(); ksort($params); foreach($params as $key => $value) { $return[] = rawurlencode($key) . '=' . rawurlencode($value); } print_r("hello");exit; return $method . "&" . rawurlencode($baseURI) . '&' . rawurlencode(implode('&', $return)); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8tZRb
function name:  (null)
number of ops:  12
compiled vars:  !0 = $baseURI, !1 = $method, !2 = $params
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'https%3A%2F%2Fapi.twitter.com%2F1.1%2Fsearch%2Ftweets.json'
    3     1        ASSIGN                                                   !1, 'GET'
    4     2        ASSIGN                                                   !2, <array>
    6     3        INIT_FCALL                                               'print_r'
          4        INIT_FCALL_BY_NAME                                       'process'
          5        SEND_VAR_EX                                              !0
          6        SEND_VAR_EX                                              !1
          7        SEND_VAR_EX                                              !2
          8        DO_FCALL                                      0  $6      
          9        SEND_VAR                                                 $6
         10        DO_ICALL                                                 
   18    11      > RETURN                                                   1

Function process:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 21
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 21
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 21
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 21
filename:       /in/8tZRb
function name:  process
number of ops:  42
compiled vars:  !0 = $baseURI, !1 = $method, !2 = $params, !3 = $return, !4 = $value, !5 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
    9     3        ASSIGN                                                   !3, <array>
   10     4        INIT_FCALL                                               'ksort'
          5        SEND_REF                                                 !2
          6        DO_ICALL                                                 
   12     7      > FE_RESET_R                                       $8      !2, ->21
          8    > > FE_FETCH_R                                       ~9      $8, !4, ->21
          9    >   ASSIGN                                                   !5, ~9
   14    10        INIT_FCALL                                               'rawurlencode'
         11        SEND_VAR                                                 !5
         12        DO_ICALL                                         $12     
         13        CONCAT                                           ~13     $12, '%3D'
         14        INIT_FCALL                                               'rawurlencode'
         15        SEND_VAR                                                 !4
         16        DO_ICALL                                         $14     
         17        CONCAT                                           ~15     ~13, $14
         18        ASSIGN_DIM                                               !3
         19        OP_DATA                                                  ~15
   12    20      > JMP                                                      ->8
         21    >   FE_FREE                                                  $8
   16    22        INIT_FCALL                                               'print_r'
         23        SEND_VAL                                                 'hello'
         24        DO_ICALL                                                 
         25      > EXIT                                                     
   17    26*       CONCAT                                           ~17     !1, '%26'
         27*       INIT_FCALL                                               'rawurlencode'
         28*       SEND_VAR                                                 !0
         29*       DO_ICALL                                         $18     
         30*       CONCAT                                           ~19     ~17, $18
         31*       CONCAT                                           ~20     ~19, '%26'
         32*       INIT_FCALL                                               'rawurlencode'
         33*       INIT_FCALL                                               'implode'
         34*       SEND_VAL                                                 '%26'
         35*       SEND_VAR                                                 !3
         36*       DO_ICALL                                         $21     
         37*       SEND_VAR                                                 $21
         38*       DO_ICALL                                         $22     
         39*       CONCAT                                           ~23     ~20, $22
         40*       RETURN                                                   ~23
   18    41*     > RETURN                                                   null

End of function process

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.67 ms | 1400 KiB | 21 Q