3v4l.org

run code in 300+ PHP versions simultaneously
<?php function convertParametersForGetRequest( $lead ) { $parameters = ""; foreach( $lead as $key => $value ) { $parameters .= empty( $parameters ) ? "{$key}={$value}" : "&{$key}={$value}"; } return $parameters; } $a = [ 'gateway_id' => '1', 'email' => '2', 'firstName' => '3', 'lastName' => '4', 'genter' => '5', 'city' => '6', 'postalCode' => '7', ]; echo convertParametersForGetRequest($a);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7JJER
function name:  (null)
number of ops:  6
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   ASSIGN                                                   !0, <array>
   24     1        INIT_FCALL                                               'convertparametersforgetrequest'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0  $2      
          4        ECHO                                                     $2
          5      > RETURN                                                   1

Function convertparametersforgetrequest:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 19
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 19
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 12
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/7JJER
function name:  convertParametersForGetRequest
number of ops:  22
compiled vars:  !0 = $lead, !1 = $parameters, !2 = $value, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        ASSIGN                                                   !1, ''
    6     2      > FE_RESET_R                                       $5      !0, ->19
          3    > > FE_FETCH_R                                       ~6      $5, !2, ->19
          4    >   ASSIGN                                                   !3, ~6
    7     5        ISSET_ISEMPTY_CV                                         !1
          6      > JMPZ                                                     ~8, ->12
    8     7    >   ROPE_INIT                                     3  ~10     !3
          8        ROPE_ADD                                      1  ~10     ~10, '%3D'
          9        ROPE_END                                      2  ~9      ~10, !2
         10        QM_ASSIGN                                        ~12     ~9
         11      > JMP                                                      ->17
    9    12    >   ROPE_INIT                                     4  ~14     '%26'
         13        ROPE_ADD                                      1  ~14     ~14, !3
         14        ROPE_ADD                                      2  ~14     ~14, '%3D'
         15        ROPE_END                                      3  ~13     ~14, !2
         16        QM_ASSIGN                                        ~12     ~13
         17    >   ASSIGN_OP                                     8          !1, ~12
    6    18      > JMP                                                      ->3
         19    >   FE_FREE                                                  $5
   13    20      > RETURN                                                   !1
   14    21*     > RETURN                                                   null

End of function convertparametersforgetrequest

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.99 ms | 1399 KiB | 14 Q