3v4l.org

run code in 300+ PHP versions simultaneously
<?php function encodePost(array $post, $print=false){ $_post_string = array(); foreach($post as $key=>$value){ if(!is_array($value)){ $_post_string[] = $key."=".urlencode($value); }else{ foreach($value as $k=>$v){ $_post_string[] = $key."[]=".urlencode($v); } } } $_post_string = implode("&",$_post_string); if($print){ echo "<br/>".$_post_string."<br/>"; } return $_post_string; } $post = [ 'hash' => '62d417c8554711d322887588ed8ab3dd4636c8d5', 'product' => PROD_LITIGANT_ALERT_NAME, 'hits' => 20, 'rows' => 1000, 'billable_rows' => 850, 'errors' => [ '567 - Unknown zipcode [ignoring]', '23 - Invalid radius format [using default]', '150 - Data does not match header count, 1 extra columns [not searching]' ], 'submitted' => '2018-04-25 15:24:32', 'completed' => '2018-04-25 16:01:12' ]; encodePost($post, true);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dfVBM
function name:  (null)
number of ops:  15
compiled vars:  !0 = $post
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   INIT_ARRAY                                       ~1      '62d417c8554711d322887588ed8ab3dd4636c8d5', 'hash'
   24     1        FETCH_CONSTANT                                   ~2      'PROD_LITIGANT_ALERT_NAME'
          2        ADD_ARRAY_ELEMENT                                ~1      ~2, 'product'
   25     3        ADD_ARRAY_ELEMENT                                ~1      20, 'hits'
   26     4        ADD_ARRAY_ELEMENT                                ~1      1000, 'rows'
   27     5        ADD_ARRAY_ELEMENT                                ~1      850, 'billable_rows'
   23     6        ADD_ARRAY_ELEMENT                                ~1      <array>, 'errors'
   33     7        ADD_ARRAY_ELEMENT                                ~1      '2018-04-25+15%3A24%3A32', 'submitted'
   34     8        ADD_ARRAY_ELEMENT                                ~1      '2018-04-25+16%3A01%3A12', 'completed'
   22     9        ASSIGN                                                   !0, ~1
   39    10        INIT_FCALL                                               'encodepost'
         11        SEND_VAR                                                 !0
         12        SEND_VAL                                                 <true>
         13        DO_FCALL                                      0          
         14      > RETURN                                                   1

Function encodepost:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 30
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 30
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 17
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 17
2 jumps found. (Code = 77) Position 1 = 18, Position 2 = 28
Branch analysis from position: 18
2 jumps found. (Code = 78) Position 1 = 19, Position 2 = 28
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 28
Branch analysis from position: 30
2 jumps found. (Code = 43) Position 1 = 37, Position 2 = 40
Branch analysis from position: 37
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 40
Branch analysis from position: 30
filename:       /in/dfVBM
function name:  encodePost
number of ops:  42
compiled vars:  !0 = $post, !1 = $print, !2 = $_post_string, !3 = $value, !4 = $key, !5 = $v, !6 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      <false>
    3     2        ASSIGN                                                   !2, <array>
    4     3      > FE_RESET_R                                       $8      !0, ->30
          4    > > FE_FETCH_R                                       ~9      $8, !3, ->30
          5    >   ASSIGN                                                   !4, ~9
    5     6        TYPE_CHECK                                  128  ~11     !3
          7        BOOL_NOT                                         ~12     ~11
          8      > JMPZ                                                     ~12, ->17
    6     9    >   CONCAT                                           ~14     !4, '%3D'
         10        INIT_FCALL                                               'urlencode'
         11        SEND_VAR                                                 !3
         12        DO_ICALL                                         $15     
         13        CONCAT                                           ~16     ~14, $15
         14        ASSIGN_DIM                                               !2
         15        OP_DATA                                                  ~16
         16      > JMP                                                      ->29
    8    17    > > FE_RESET_R                                       $17     !3, ->28
         18    > > FE_FETCH_R                                       ~18     $17, !5, ->28
         19    >   ASSIGN                                                   !6, ~18
    9    20        CONCAT                                           ~21     !4, '%5B%5D%3D'
         21        INIT_FCALL                                               'urlencode'
         22        SEND_VAR                                                 !5
         23        DO_ICALL                                         $22     
         24        CONCAT                                           ~23     ~21, $22
         25        ASSIGN_DIM                                               !2
         26        OP_DATA                                                  ~23
    8    27      > JMP                                                      ->18
         28    >   FE_FREE                                                  $17
    4    29    > > JMP                                                      ->4
         30    >   FE_FREE                                                  $8
   14    31        INIT_FCALL                                               'implode'
         32        SEND_VAL                                                 '%26'
         33        SEND_VAR                                                 !2
         34        DO_ICALL                                         $24     
         35        ASSIGN                                                   !2, $24
   15    36      > JMPZ                                                     !1, ->40
   16    37    >   CONCAT                                           ~26     '%3Cbr%2F%3E', !2
         38        CONCAT                                           ~27     ~26, '%3Cbr%2F%3E'
         39        ECHO                                                     ~27
   19    40    > > RETURN                                                   !2
   20    41*     > RETURN                                                   null

End of function encodepost

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.69 ms | 1403 KiB | 18 Q