3v4l.org

run code in 300+ PHP versions simultaneously
<?php $params = [ 'param1' => 1, 'param2' => new Class { public function __toString():string {return 'test';} } ]; echo http_build_query($params) . PHP_EOL; foreach ($params as $k => &$v) $params[$k] = (string) $v; echo http_build_query($params) . PHP_EOL;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 12, Position 2 = 18
Branch analysis from position: 12
2 jumps found. (Code = 126) Position 1 = 13, Position 2 = 18
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/QgTBU
function name:  (null)
number of ops:  25
compiled vars:  !0 = $params, !1 = $v, !2 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_ARRAY                                       ~3      1, 'param1'
    5     1        DECLARE_ANON_CLASS                               <true>  
          2        NEW                                              $5      $4
          3        DO_FCALL                                      0          
          4        ADD_ARRAY_ELEMENT                                ~3      $5, 'param2'
    3     5        ASSIGN                                                   !0, ~3
   10     6        INIT_FCALL                                               'http_build_query'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $8      
          9        CONCAT                                           ~9      $8, '%0A'
         10        ECHO                                                     ~9
   12    11      > FE_RESET_RW                                      $10     !0, ->18
         12    > > FE_FETCH_RW                                      ~11     $10, !1, ->18
         13    >   ASSIGN                                                   !2, ~11
         14        CAST                                          6  ~14     !1
         15        ASSIGN_DIM                                               !0, !2
         16        OP_DATA                                                  ~14
         17      > JMP                                                      ->12
         18    >   FE_FREE                                                  $10
   14    19        INIT_FCALL                                               'http_build_query'
         20        SEND_VAR                                                 !0
         21        DO_ICALL                                         $15     
         22        CONCAT                                           ~16     $15, '%0A'
         23        ECHO                                                     ~16
   15    24      > RETURN                                                   1

Class class@anonymous:
Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QgTBU
function name:  __toString
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E > > RETURN                                                   'test'
          1*       VERIFY_RETURN_TYPE                                       
          2*     > RETURN                                                   null

End of function __tostring

End of class class@anonymous.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.12 ms | 1068 KiB | 14 Q