3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A1 { protected function a () { $i =0 ; while (true) { $i++; if ($i > 10000) { break; } foreach ([['a' => 1],2, ['a' => 2]] as $p) { if ($p == 2) { continue; } yield $p['a'] => 123; } } } public function b(){ $sum = 0; foreach ( a() as $k => $v ) { $sum += $k + $v; } echo 'Done: ', $sum; } } (new A1)->b();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Y6MHM
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   NEW                                              $0      'A1'
          1        DO_FCALL                                      0          
          2        INIT_METHOD_CALL                                         $0, 'b'
          3        DO_FCALL                                      0          
          4      > RETURN                                                   1

Class A1:
Function a:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 3
Branch analysis from position: 17
1 jumps found. (Code = 161) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 7
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 7
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 15
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 15
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 12
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 3
Branch analysis from position: 17
Branch analysis from position: 3
Branch analysis from position: 15
filename:       /in/Y6MHM
function name:  a
number of ops:  18
compiled vars:  !0 = $i, !1 = $p
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   GENERATOR_CREATE                                         
    4     1        ASSIGN                                                   !0, 0
    5     2      > JMP                                                      ->16
    6     3    >   PRE_INC                                                  !0
    7     4        IS_SMALLER                                               10000, !0
          5      > JMPZ                                                     ~4, ->7
          6    > > JMP                                                      ->17
    8     7    > > FE_RESET_R                                       $5      <array>, ->15
          8    > > FE_FETCH_R                                               $5, !1, ->15
    9     9    >   IS_EQUAL                                                 !1, 2
         10      > JMPZ                                                     ~6, ->12
   10    11    > > JMP                                                      ->8
   12    12    >   FETCH_DIM_R                                      ~7      !1, 'a'
         13        YIELD                                                    123, ~7
    8    14      > JMP                                                      ->8
         15    >   FE_FREE                                                  $5
    5    16    > > JMPNZ                                                    <true>, ->3
   15    17    > > GENERATOR_RETURN                                         

End of function a

Function b:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 9
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 9
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
filename:       /in/Y6MHM
function name:  b
number of ops:  13
compiled vars:  !0 = $sum, !1 = $v, !2 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   ASSIGN                                                   !0, 0
   18     1        INIT_FCALL_BY_NAME                                       'a'
          2        DO_FCALL                                      0  $4      
          3      > FE_RESET_R                                       $5      $4, ->9
          4    > > FE_FETCH_R                                       ~6      $5, !1, ->9
          5    >   ASSIGN                                                   !2, ~6
   19     6        ADD                                              ~8      !2, !1
          7        ASSIGN_OP                                     1          !0, ~8
   18     8      > JMP                                                      ->4
          9    >   FE_FREE                                                  $5
   21    10        ECHO                                                     'Done%3A+'
         11        ECHO                                                     !0
   22    12      > RETURN                                                   null

End of function b

End of class A1.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.33 ms | 1403 KiB | 13 Q