3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface ProcessInterface { } interface RewindIterator extends Iterator { public function previous(): void; } interface ProcessListInterface extends RewindIterator { public function append(ProcessInterface $process): void; public function clear(): void; public function isEmpty(): bool; } final class ProcessList implements ProcessListInterface { private $processes = []; public function __construct(array $processes = []) { foreach ($processes as $process) { $this->append($process); } } public function append(ProcessInterface $process): void { $this->processes[] = $process; } public function clear(): void { $this->processes = []; } public function isEmpty(): bool { return empty($this->processes); } public function rewind(): ProcessInterface { return reset($this->processes); } public function current(): ProcessInterface { return current($this->processes); } public function key(): int { return key($this->processes); } public function next(): ProcessInterface { return next($this->processes); } public function previous(): ProcessInterface { return prev($this->processes); } public function valid(): bool { return key($this->processes) !== null; } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/STpuP
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   DECLARE_CLASS                                            'rewinditerator'
   12     1        DECLARE_CLASS                                            'processlistinterface'
   19     2        DECLARE_CLASS                                            'processlist'
   74     3      > RETURN                                                   1

Class ProcessInterface: [no user functions]
Class RewindIterator:
Function previous:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/STpuP
function name:  previous
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E > > RETURN                                                   null

End of function previous

End of class RewindIterator.

Class ProcessListInterface:
Function append:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/STpuP
function name:  append
number of ops:  2
compiled vars:  !0 = $process
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
          1      > RETURN                                                   null

End of function append

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

End of function clear

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

End of function isempty

End of class ProcessListInterface.

Class ProcessList:
Function __construct:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 7
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 7
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/STpuP
function name:  __construct
number of ops:  9
compiled vars:  !0 = $processes, !1 = $process
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   RECV_INIT                                        !0      <array>
   25     1      > FE_RESET_R                                       $2      !0, ->7
          2    > > FE_FETCH_R                                               $2, !1, ->7
   26     3    >   INIT_METHOD_CALL                                         'append'
          4        SEND_VAR_EX                                              !1
          5        DO_FCALL                                      0          
   25     6      > JMP                                                      ->2
          7    >   FE_FREE                                                  $2
   28     8      > RETURN                                                   null

End of function __construct

Function append:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/STpuP
function name:  append
number of ops:  5
compiled vars:  !0 = $process
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   RECV                                             !0      
   32     1        FETCH_OBJ_W                                      $1      'processes'
          2        ASSIGN_DIM                                               $1
          3        OP_DATA                                                  !0
   33     4      > RETURN                                                   null

End of function append

Function clear:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/STpuP
function name:  clear
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   37     0  E >   ASSIGN_OBJ                                               'processes'
          1        OP_DATA                                                  <array>
   38     2      > RETURN                                                   null

End of function clear

Function isempty:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/STpuP
function name:  isEmpty
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   42     0  E >   ISSET_ISEMPTY_PROP_OBJ                           ~0      'processes'
          1        VERIFY_RETURN_TYPE                                       ~0
          2      > RETURN                                                   ~0
   43     3*       VERIFY_RETURN_TYPE                                       
          4*     > RETURN                                                   null

End of function isempty

Function rewind:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/STpuP
function name:  rewind
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   47     0  E >   INIT_FCALL                                               'reset'
          1        FETCH_OBJ_W                                      $0      'processes'
          2        SEND_REF                                                 $0
          3        DO_ICALL                                         $1      
          4        VERIFY_RETURN_TYPE                                       $1
          5      > RETURN                                                   $1
   48     6*       VERIFY_RETURN_TYPE                                       
          7*     > RETURN                                                   null

End of function rewind

Function current:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/STpuP
function name:  current
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   52     0  E >   INIT_FCALL                                               'current'
          1        FETCH_OBJ_R                                      ~0      'processes'
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                         $1      
          4        VERIFY_RETURN_TYPE                                       $1
          5      > RETURN                                                   $1
   53     6*       VERIFY_RETURN_TYPE                                       
          7*     > RETURN                                                   null

End of function current

Function key:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/STpuP
function name:  key
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   57     0  E >   INIT_FCALL                                               'key'
          1        FETCH_OBJ_R                                      ~0      'processes'
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                         $1      
          4        VERIFY_RETURN_TYPE                                       $1
          5      > RETURN                                                   $1
   58     6*       VERIFY_RETURN_TYPE                                       
          7*     > RETURN                                                   null

End of function key

Function next:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/STpuP
function name:  next
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   62     0  E >   INIT_FCALL                                               'next'
          1        FETCH_OBJ_W                                      $0      'processes'
          2        SEND_REF                                                 $0
          3        DO_ICALL                                         $1      
          4        VERIFY_RETURN_TYPE                                       $1
          5      > RETURN                                                   $1
   63     6*       VERIFY_RETURN_TYPE                                       
          7*     > RETURN                                                   null

End of function next

Function previous:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/STpuP
function name:  previous
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   67     0  E >   INIT_FCALL                                               'prev'
          1        FETCH_OBJ_W                                      $0      'processes'
          2        SEND_REF                                                 $0
          3        DO_ICALL                                         $1      
          4        VERIFY_RETURN_TYPE                                       $1
          5      > RETURN                                                   $1
   68     6*       VERIFY_RETURN_TYPE                                       
          7*     > RETURN                                                   null

End of function previous

Function valid:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/STpuP
function name:  valid
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   72     0  E >   INIT_FCALL                                               'key'
          1        FETCH_OBJ_R                                      ~0      'processes'
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                         $1      
          4        TYPE_CHECK                                  1020  ~2      $1
          5        VERIFY_RETURN_TYPE                                       ~2
          6      > RETURN                                                   ~2
   73     7*       VERIFY_RETURN_TYPE                                       
          8*     > RETURN                                                   null

End of function valid

End of class ProcessList.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.66 ms | 1412 KiB | 24 Q