3v4l.org

run code in 300+ PHP versions simultaneously
<?php function postLikeStrToArray($str) { $_p = explode('&', $str); $post = []; foreach ($_p as $item) { $parts = explode('=', $item); $key = strtolower($parts[0]); $value = urldecode($parts[1]); $post[$key] = $value; } return $post; } $resp = urldecode("MerID=I0110DQX&amp;OrderID=191&amp;ResponseCode=3&amp;ReasonCode=11&amp;ReasonCodeDesc=Invalid+signature&amp;Signature=hHxm7Zd1GeUJz3ZfkloaNG%2BC1hk%3D"); $post = postLikeStrToArray($resp); print_r($post);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DTgkX
function name:  (null)
number of ops:  12
compiled vars:  !0 = $resp, !1 = $post
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_FCALL                                               'urldecode'
          1        SEND_VAL                                                 'MerID%3DI0110DQX%26amp%3BOrderID%3D191%26amp%3BResponseCode%3D3%26amp%3BReasonCode%3D11%26amp%3BReasonCodeDesc%3DInvalid%2Bsignature%26amp%3BSignature%3DhHxm7Zd1GeUJz3ZfkloaNG%252BC1hk%253D'
          2        DO_ICALL                                         $2      
          3        ASSIGN                                                   !0, $2
   15     4        INIT_FCALL                                               'postlikestrtoarray'
          5        SEND_VAR                                                 !0
          6        DO_FCALL                                      0  $4      
          7        ASSIGN                                                   !1, $4
   16     8        INIT_FCALL                                               'print_r'
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

Function postlikestrtoarray:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 27
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 27
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
filename:       /in/DTgkX
function name:  postLikeStrToArray
number of ops:  30
compiled vars:  !0 = $str, !1 = $_p, !2 = $post, !3 = $item, !4 = $parts, !5 = $key, !6 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '%26'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $7      
          5        ASSIGN                                                   !1, $7
    5     6        ASSIGN                                                   !2, <array>
    6     7      > FE_RESET_R                                       $10     !1, ->27
          8    > > FE_FETCH_R                                               $10, !3, ->27
    7     9    >   INIT_FCALL                                               'explode'
         10        SEND_VAL                                                 '%3D'
         11        SEND_VAR                                                 !3
         12        DO_ICALL                                         $11     
         13        ASSIGN                                                   !4, $11
    8    14        INIT_FCALL                                               'strtolower'
         15        FETCH_DIM_R                                      ~13     !4, 0
         16        SEND_VAL                                                 ~13
         17        DO_ICALL                                         $14     
         18        ASSIGN                                                   !5, $14
    9    19        INIT_FCALL                                               'urldecode'
         20        FETCH_DIM_R                                      ~16     !4, 1
         21        SEND_VAL                                                 ~16
         22        DO_ICALL                                         $17     
         23        ASSIGN                                                   !6, $17
   10    24        ASSIGN_DIM                                               !2, !5
         25        OP_DATA                                                  !6
    6    26      > JMP                                                      ->8
         27    >   FE_FREE                                                  $10
   12    28      > RETURN                                                   !2
   13    29*     > RETURN                                                   null

End of function postlikestrtoarray

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.57 ms | 1403 KiB | 22 Q