3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface foo { public function getThing() : \Traversable; } class mything implements foo { public function getThing() : \ArrayIterator { return new \ArrayIterator([]); } } $xxx = new mything;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OXL0o
function name:  (null)
number of ops:  5
compiled vars:  !0 = $xxx
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   DECLARE_CLASS                                            'mything'
   15     1        NEW                                              $1      'mything'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
          4      > RETURN                                                   1

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

End of function getthing

End of class foo.

Class mything:
Function getthing:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OXL0o
function name:  getThing
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   NEW                                              $0      'ArrayIterator'
          1        SEND_VAL_EX                                              <array>
          2        DO_FCALL                                      0          
          3        VERIFY_RETURN_TYPE                                       $0
          4      > RETURN                                                   $0
   12     5*       VERIFY_RETURN_TYPE                                       
          6*     > RETURN                                                   null

End of function getthing

End of class mything.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.52 ms | 1393 KiB | 13 Q