3v4l.org

run code in 300+ PHP versions simultaneously
<?php $walk = function( $item, $key, $parent_key = '' ) use ( &$output, &$walk ) { is_array( $item ) ? array_walk( $item, $walk, $key ) : $output[] = http_build_query( array( $parent_key ?: $key => $item ) ); }; $array = array( 'order_source' => array('google','facebook'), 'order_medium' => 'google-text' ); array_walk( $array, $walk ); echo implode( '&', $output ); // order_source=google&order_source=facebook&order_medium=google-text
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FMRZi
function name:  (null)
number of ops:  15
compiled vars:  !0 = $walk, !1 = $output, !2 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FFMRZi%3A2%240'
          1        BIND_LEXICAL                                             ~3, !1
          2        BIND_LEXICAL                                             ~3, !0
          3        ASSIGN                                                   !0, ~3
   10     4        ASSIGN                                                   !2, <array>
   15     5        INIT_FCALL                                               'array_walk'
          6        SEND_REF                                                 !2
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                                 
   17     9        INIT_FCALL                                               'implode'
         10        SEND_VAL                                                 '%26'
         11        SEND_VAR                                                 !1
         12        DO_ICALL                                         $7      
         13        ECHO                                                     $7
         14      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FFMRZi%3A2%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 14
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FMRZi
function name:  {closure}
number of ops:  25
compiled vars:  !0 = $item, !1 = $key, !2 = $parent_key, !3 = $output, !4 = $walk
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV_INIT                                        !2      ''
          3        BIND_STATIC                                              !3
          4        BIND_STATIC                                              !4
    4     5        TYPE_CHECK                                  128          !0
          6      > JMPZ                                                     ~5, ->14
    5     7    >   INIT_FCALL                                               'array_walk'
          8        SEND_REF                                                 !0
          9        SEND_VAR                                                 !4
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                         $6      
         12        QM_ASSIGN                                        ~7      $6
         13      > JMP                                                      ->23
    6    14    >   INIT_FCALL                                               'http_build_query'
         15        JMP_SET                                          ~9      !2, ->17
         16        QM_ASSIGN                                        ~9      !1
         17        INIT_ARRAY                                       ~10     !0, ~9
         18        SEND_VAL                                                 ~10
         19        DO_ICALL                                         $11     
         20        ASSIGN_DIM                                       ~8      !3
         21        OP_DATA                                                  $11
         22        QM_ASSIGN                                        ~7      ~8
         23    >   FREE                                                     ~7
    8    24      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FFMRZi%3A2%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.48 ms | 1400 KiB | 19 Q