3v4l.org

run code in 500+ PHP versions simultaneously
<?php interface RangeFinderInterface { public function doStuff(): self; } class RangeFinder implements RangeFinderInterface { public function doStuff(): self { echo 'hello world', "\n"; return $this; } } $rf = new RangeFinder; $rf->doStuff()->doStuff()->doStuff();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Du4hj
function name:  (null)
number of ops:  11
compiled vars:  !0 = $rf
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E >   DECLARE_CLASS                                                'rangefinder'
   14     1        NEW                                                  $1      'RangeFinder'
          2        DO_FCALL                                          0          
          3        ASSIGN                                                       !0, $1
   15     4        INIT_METHOD_CALL                                             !0, 'doStuff'
          5        DO_FCALL                                          0  $4      
          6        INIT_METHOD_CALL                                             $4, 'doStuff'
          7        DO_FCALL                                          0  $5      
          8        INIT_METHOD_CALL                                             $5, 'doStuff'
          9        DO_FCALL                                          0          
         10      > RETURN                                                       1

Class RangeFinderInterface:
Function dostuff:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Du4hj
function name:  doStuff
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 dostuff

End of class RangeFinderInterface.

Class RangeFinder:
Function dostuff:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Du4hj
function name:  doStuff
number of ops:  7
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    9     0  E >   ECHO                                                         'hello+world'
          1        ECHO                                                         '%0A'
   10     2        FETCH_THIS                                           ~0      
          3        VERIFY_RETURN_TYPE                                           ~0
          4      > RETURN                                                       ~0
   11     5*       VERIFY_RETURN_TYPE                                           
          6*     > RETURN                                                       null

End of function dostuff

End of class RangeFinder.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
156.89 ms | 2113 KiB | 13 Q