3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo { public function __toString() { return "bar"; } } $params = array(); $params['a'] = 'b'; $params['foo'] = (string) new foo(); $query = http_build_query($params); var_dump($params, $query);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/eMb8J
function name:  (null)
number of ops:  18
compiled vars:  !0 = $params, !1 = $query
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'foo'
   11     1        ASSIGN                                                   !0, <array>
   12     2        ASSIGN_DIM                                               !0, 'a'
          3        OP_DATA                                                  'b'
   13     4        NEW                                              $5      'foo'
          5        DO_FCALL                                      0          
          6        CAST                                          6  ~7      $5
          7        ASSIGN_DIM                                               !0, 'foo'
          8        OP_DATA                                                  ~7
   15     9        INIT_FCALL                                               'http_build_query'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                         $8      
         12        ASSIGN                                                   !1, $8
   17    13        INIT_FCALL                                               'var_dump'
         14        SEND_VAR                                                 !0
         15        SEND_VAR                                                 !1
         16        DO_ICALL                                                 
         17      > RETURN                                                   1

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

End of function __tostring

End of class foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.61 ms | 1395 KiB | 17 Q