3v4l.org

run code in 300+ PHP versions simultaneously
<?php function NVPToArray($NVPString) { $proArray = array(); while(strlen($NVPString)) { // name $keypos= strpos($NVPString,'='); $keyval = substr($NVPString,0,$keypos); // value $valuepos = strpos($NVPString,'&') ? strpos($NVPString,'&'): strlen($NVPString); $valval = substr($NVPString,$keypos+1,$valuepos-$keypos-1); // decoding the respose $proArray[$keyval] = urldecode($valval); $NVPString = substr($NVPString,$valuepos+1,strlen($NVPString)); } return $proArray; } $array = NVPToArray("BUTTONSOURCE[18]=AngellEYE_PHPClass&VERBOSITY[4]=HIGH"); print_r($array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8vG8m
function name:  (null)
number of ops:  8
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   INIT_FCALL                                               'nvptoarray'
          1        SEND_VAL                                                 'BUTTONSOURCE%5B18%5D%3DAngellEYE_PHPClass%26VERBOSITY%5B4%5D%3DHIGH'
          2        DO_FCALL                                      0  $1      
          3        ASSIGN                                                   !0, $1
   24     4        INIT_FCALL                                               'print_r'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Function nvptoarray:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 50
Branch analysis from position: 50
2 jumps found. (Code = 44) Position 1 = 52, Position 2 = 3
Branch analysis from position: 52
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 25
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
2 jumps found. (Code = 44) Position 1 = 52, Position 2 = 3
Branch analysis from position: 52
Branch analysis from position: 3
Branch analysis from position: 25
2 jumps found. (Code = 44) Position 1 = 52, Position 2 = 3
Branch analysis from position: 52
Branch analysis from position: 3
filename:       /in/8vG8m
function name:  NVPToArray
number of ops:  54
compiled vars:  !0 = $NVPString, !1 = $proArray, !2 = $keypos, !3 = $keyval, !4 = $valuepos, !5 = $valval
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        ASSIGN                                                   !1, <array>
    6     2      > JMP                                                      ->50
    9     3    >   INIT_FCALL                                               'strpos'
          4        SEND_VAR                                                 !0
          5        SEND_VAL                                                 '%3D'
          6        DO_ICALL                                         $7      
          7        ASSIGN                                                   !2, $7
   10     8        INIT_FCALL                                               'substr'
          9        SEND_VAR                                                 !0
         10        SEND_VAL                                                 0
         11        SEND_VAR                                                 !2
         12        DO_ICALL                                         $9      
         13        ASSIGN                                                   !3, $9
   12    14        INIT_FCALL                                               'strpos'
         15        SEND_VAR                                                 !0
         16        SEND_VAL                                                 '%26'
         17        DO_ICALL                                         $11     
         18      > JMPZ                                                     $11, ->25
         19    >   INIT_FCALL                                               'strpos'
         20        SEND_VAR                                                 !0
         21        SEND_VAL                                                 '%26'
         22        DO_ICALL                                         $12     
         23        QM_ASSIGN                                        ~13     $12
         24      > JMP                                                      ->27
         25    >   STRLEN                                           ~14     !0
         26        QM_ASSIGN                                        ~13     ~14
         27    >   ASSIGN                                                   !4, ~13
   13    28        INIT_FCALL                                               'substr'
         29        SEND_VAR                                                 !0
         30        ADD                                              ~16     !2, 1
         31        SEND_VAL                                                 ~16
         32        SUB                                              ~17     !4, !2
         33        SUB                                              ~18     ~17, 1
         34        SEND_VAL                                                 ~18
         35        DO_ICALL                                         $19     
         36        ASSIGN                                                   !5, $19
   15    37        INIT_FCALL                                               'urldecode'
         38        SEND_VAR                                                 !5
         39        DO_ICALL                                         $22     
         40        ASSIGN_DIM                                               !1, !3
         41        OP_DATA                                                  $22
   16    42        INIT_FCALL                                               'substr'
         43        SEND_VAR                                                 !0
         44        ADD                                              ~23     !4, 1
         45        SEND_VAL                                                 ~23
         46        STRLEN                                           ~24     !0
         47        SEND_VAL                                                 ~24
         48        DO_ICALL                                         $25     
         49        ASSIGN                                                   !0, $25
    6    50    >   STRLEN                                           ~27     !0
         51      > JMPNZ                                                    ~27, ->3
   19    52    > > RETURN                                                   !1
   21    53*     > RETURN                                                   null

End of function nvptoarray

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.78 ms | 1403 KiB | 22 Q