3v4l.org

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

Class Foo:
Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NLUQQ
function name:  __toString
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E > > RETURN                                                   'Bar'
    7     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:
157.85 ms | 1395 KiB | 15 Q