3v4l.org

run code in 500+ PHP versions simultaneously
<?php $p = array('order_status' => array('google','facebook'), 'agent' => array('James')); function bqs($array, $qs='',$index = false) { foreach($array as $par => $val) { if($index) $par = $index; if(is_array($val)) { $qs = bqs($val, $qs,$par); } else { $qs .= $par.'='.$val.'&'; } } return $qs; } echo bqs($p);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QHF5G
function name:  (null)
number of ops:  6
compiled vars:  !0 = $p
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, <array>
   23     1        INIT_FCALL                                                   'bqs'
          2        SEND_VAR                                                     !0
          3        DO_FCALL                                          0  $2      
          4        ECHO                                                         $2
          5      > RETURN                                                       1

Function bqs:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 22
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 22
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 8
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 17
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 8
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/QHF5G
function name:  bqs
number of ops:  25
compiled vars:  !0 = $array, !1 = $qs, !2 = $index, !3 = $val, !4 = $par
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   RECV                                                 !0      
          1        RECV_INIT                                            !1      ''
          2        RECV_INIT                                            !2      <false>
    6     3      > FE_RESET_R                                           $5      !0, ->22
          4    > > FE_FETCH_R                                           ~6      $5, !3, ->22
          5    >   ASSIGN                                                       !4, ~6
    8     6      > JMPZ                                                         !2, ->8
    9     7    >   ASSIGN                                                       !4, !2
   11     8    >   TYPE_CHECK                                      128          !3
          9      > JMPZ                                                         ~9, ->17
   13    10    >   INIT_FCALL_BY_NAME                                           'bqs'
         11        SEND_VAR_EX                                                  !3
         12        SEND_VAR_EX                                                  !1
         13        SEND_VAR_EX                                                  !4
         14        DO_FCALL                                          0  $10     
         15        ASSIGN                                                       !1, $10
   11    16      > JMP                                                          ->21
   17    17    >   CONCAT                                               ~12     !4, '%3D'
         18        CONCAT                                               ~13     ~12, !3
         19        CONCAT                                               ~14     ~13, '%26'
         20        ASSIGN_OP                                         8          !1, ~14
    6    21    > > JMP                                                          ->4
         22    >   FE_FREE                                                      $5
   20    23      > RETURN                                                       !1
   21    24*     > RETURN                                                       null

End of function bqs

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
177.82 ms | 2759 KiB | 14 Q