3v4l.org

run code in 500+ PHP versions simultaneously
<?php trait IterableTerminalsLogic { public function single(): true { return true; } } class Collection { use IterableTerminalsLogic; } class Sequence { use IterableTerminalsLogic { single as internalSingle; } #[NoDiscard] public function single(): true { return $this->internalSingle(); } } new Collection()->single(); new Sequence()->single();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mFDBn
function name:  (null)
number of ops:  11
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   11     0  E >   DECLARE_CLASS                                                'collection'
   16     1        DECLARE_CLASS                                                'sequence'
   29     2        NEW                                                  $0      'Collection'
          3        DO_FCALL                                          0          
          4        INIT_METHOD_CALL                                             $0, 'single'
          5        DO_FCALL                                          0          
   30     6        NEW                                                  $3      'Sequence'
          7        DO_FCALL                                          0          
          8        INIT_METHOD_CALL                                             $3, 'single'
          9        DO_FCALL                                          0          
         10      > RETURN                                                       1

Class IterableTerminalsLogic:
Function single:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mFDBn
function name:  single
number of ops:  3
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E > > RETURN                                                       <true>
    8     1*       VERIFY_RETURN_TYPE                                           
          2*     > RETURN                                                       null

End of function single

End of class IterableTerminalsLogic.

Class Collection: [no user functions]
Class Sequence:
Function single:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mFDBn
function name:  single
number of ops:  6
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   25     0  E >   INIT_METHOD_CALL                                             'internalSingle'
          1        DO_FCALL                                          0  $0      
          2        VERIFY_RETURN_TYPE                                           $0
          3      > RETURN                                                       $0
   26     4*       VERIFY_RETURN_TYPE                                           
          5*     > RETURN                                                       null

End of function single

End of class Sequence.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
125.67 ms | 475 KiB | 7 Q