3v4l.org

run code in 500+ PHP versions simultaneously
<?php $params = [ 'param1' => 1, 'param2' => new Class { public $foo = 1; public $bar = 2; public function __toString():string {return 'test';} } ]; var_dump(http_build_query($params)); foreach ($params as $k => &$v) $params[$k] = (string) $v; var_dump(http_build_query($params));
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 13, Position 2 = 19
Branch analysis from position: 13
2 jumps found. (Code = 126) Position 1 = 14, Position 2 = 19
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/nH479
function name:  (null)
number of ops:  27
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
   12     6        INIT_FCALL                                                   'var_dump'
          7        INIT_FCALL                                                   'http_build_query'
          8        SEND_VAR                                                     !0
          9        DO_ICALL                                             $8      
         10        SEND_VAR                                                     $8
         11        DO_ICALL                                                     
   14    12      > FE_RESET_RW                                          $10     !0, ->19
         13    > > FE_FETCH_RW                                          ~11     $10, !1, ->19
         14    >   ASSIGN                                                       !2, ~11
         15        CAST                                              6  ~14     !1
         16        ASSIGN_DIM                                                   !0, !2
         17        OP_DATA                                                      ~14
         18      > JMP                                                          ->13
         19    >   FE_FREE                                                      $10
   16    20        INIT_FCALL                                                   'var_dump'
         21        INIT_FCALL                                                   'http_build_query'
         22        SEND_VAR                                                     !0
         23        DO_ICALL                                             $15     
         24        SEND_VAR                                                     $15
         25        DO_ICALL                                                     
         26      > 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/nH479
function name:  __toString
number of ops:  3
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     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.5.0


preferences:
137.95 ms | 2767 KiB | 10 Q