3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public function __toString() { return 'a'; } } $b = new A; $a = array('DateTime', $b); $a();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MTTDt
function name:  (null)
number of ops:  10
compiled vars:  !0 = $b, !1 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   DECLARE_CLASS                                            'a'
    7     1        NEW                                              $2      'A'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
    8     4        INIT_ARRAY                                       ~5      'DateTime'
          5        ADD_ARRAY_ELEMENT                                ~5      !0
          6        ASSIGN                                                   !1, ~5
    9     7        INIT_DYNAMIC_CALL                                        !1
          8        DO_FCALL                                      0          
          9      > RETURN                                                   1

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

End of function __tostring

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.72 ms | 1393 KiB | 13 Q