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';
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aC5j5
function name:  (null)
number of ops:  9
compiled vars:  !0 = $test, !1 = $object
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   DECLARE_CLASS                                            'foo'
   11     1        ASSIGN                                                   !0, <array>
   12     2        NEW                                              $3      'Foo'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $3
   13     5        CAST                                          6  ~6      !1
          6        ASSIGN_DIM                                               !0, ~6
          7        OP_DATA                                                  'Value'
          8      > RETURN                                                   1

Class Foo:
Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aC5j5
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:
146.37 ms | 1384 KiB | 13 Q