3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Foo {} class Foos implements IteratorAggregate { private function __construct(private readonly iterable $foos) {} public static function fromVariadic(Foo ...$foos): self { return new self($foos); } public function getIterator(): \Traversable { return new ArrayIterator($this->foos); } } $foos = Foos::fromVariadic(new Foo, new Foo);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/L71JQ
function name:  (null)
number of ops:  11
compiled vars:  !0 = $foos
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   DECLARE_CLASS                                                'foos'
   15     1        INIT_STATIC_METHOD_CALL                                      'Foos', 'fromVariadic'
          2        NEW                                                  $1      'Foo'
          3        DO_FCALL                                          0          
          4        SEND_VAR_NO_REF_EX                                           $1
          5        NEW                                                  $3      'Foo'
          6        DO_FCALL                                          0          
          7        SEND_VAR_NO_REF_EX                                           $3
          8        DO_FCALL                                          0  $5      
          9        ASSIGN                                                       !0, $5
         10      > RETURN                                                       1

Class Foo: [no user functions]
Class Foos:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/L71JQ
function name:  __construct
number of ops:  4
compiled vars:  !0 = $foos
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    6     0  E >   RECV                                                 !0      
          1        ASSIGN_OBJ                                                   'foos'
          2        OP_DATA                                                      !0
          3      > RETURN                                                       null

End of function __construct

Function fromvariadic:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/L71JQ
function name:  fromVariadic
number of ops:  8
compiled vars:  !0 = $foos
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E >   RECV_VARIADIC                                        !0      
    8     1        NEW                              self                $1      
          2        SEND_VAR_EX                                                  !0
          3        DO_FCALL                                          0          
          4        VERIFY_RETURN_TYPE                                           $1
          5      > RETURN                                                       $1
    9     6*       VERIFY_RETURN_TYPE                                           
          7*     > RETURN                                                       null

End of function fromvariadic

Function getiterator:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/L71JQ
function name:  getIterator
number of ops:  9
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   11     0  E >   NEW                                                  $0      'ArrayIterator'
          1        CHECK_FUNC_ARG                                               
          2        FETCH_OBJ_FUNC_ARG                                   $1      'foos'
          3        SEND_FUNC_ARG                                                $1
          4        DO_FCALL                                          0          
          5        VERIFY_RETURN_TYPE                                           $0
          6      > RETURN                                                       $0
   12     7*       VERIFY_RETURN_TYPE                                           
          8*     > RETURN                                                       null

End of function getiterator

End of class Foos.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
131.54 ms | 1342 KiB | 13 Q