3v4l.org

run code in 300+ PHP versions simultaneously
<?php (function() { $iterator = $this->getIterator(); foreach ($iterator as $value) { var_dump($value); } var_dump($iterator->getReturn()); })->call(new class implements IteratorAggregate { public function getIterator() { yield 0; yield from [1,2,3,4]; return 5; } });
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IgsiV
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FIgsiV%3A3%240'
    9     1        INIT_METHOD_CALL                                         ~0, 'call'
          2        DECLARE_ANON_CLASS                               <unknown> 
          3        NEW                                              $2      $1
          4        DO_FCALL                                      0          
          5        SEND_VAR_NO_REF_EX                                       $2
          6        DO_FCALL                                      0          
   16     7      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FIgsiV%3A3%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 10
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 10
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
filename:       /in/IgsiV
function name:  {closure}
number of ops:  17
compiled vars:  !0 = $iterator, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   FETCH_THIS                                       $2      
          1        INIT_METHOD_CALL                                         $2, 'getIterator'
          2        DO_FCALL                                      0  $3      
          3        ASSIGN                                                   !0, $3
    5     4      > FE_RESET_R                                       $5      !0, ->10
          5    > > FE_FETCH_R                                               $5, !1, ->10
    6     6    >   INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                                 
    5     9      > JMP                                                      ->5
         10    >   FE_FREE                                                  $5
    8    11        INIT_FCALL                                               'var_dump'
         12        INIT_METHOD_CALL                                         !0, 'getReturn'
         13        DO_FCALL                                      0  $7      
         14        SEND_VAR                                                 $7
         15        DO_ICALL                                                 
    9    16      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FIgsiV%3A3%240

Class IteratorAggregate@anonymous:
Function getiterator:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 161) Position 1 = -2
filename:       /in/IgsiV
function name:  getIterator
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   GENERATOR_CREATE                                         
   12     1        YIELD                                                    0
   13     2        YIELD_FROM                                       ~1      <array>
          3        FREE                                                     ~1
   14     4      > GENERATOR_RETURN                                         
   15     5*     > GENERATOR_RETURN                                         

End of function getiterator

End of class IteratorAggregate@anonymous.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.36 ms | 1392 KiB | 15 Q