3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A1 { protected function a() { $i = 0; $s = ''; while (true) { $i++; if ($i > 10000) { break; } foreach ([['a' => 1], 2, ['a' => 2]] as $p) { if ($p == 2) { continue; } if ($i % 100 == 0) { echo $i, memory_get_usage(), PHP_EOL; try { $s .= str_repeat('0123456789', 100000); } catch (\Exception $e) { throw $e; } } yield $p['a'] => 123; } } } public function b() { $sum = 0; try { foreach ($this->a() as $k => $v) { $sum += $k + $v; } echo 'Done: ', $sum; } catch (\Exception $e) { echo $e; } } } (new A1)->b();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ev1e1
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   46     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 = 33
Branch analysis from position: 33
2 jumps found. (Code = 44) Position 1 = 34, Position 2 = 4
Branch analysis from position: 34
1 jumps found. (Code = 161) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 8
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
Branch analysis from position: 8
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 32
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 32
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 13
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 29
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 29
Branch analysis from position: 32
2 jumps found. (Code = 44) Position 1 = 34, Position 2 = 4
Branch analysis from position: 34
Branch analysis from position: 4
Branch analysis from position: 32
Found catch point at position: 27
Branch analysis from position: 27
2 jumps found. (Code = 107) Position 1 = 28, Position 2 = -2
Branch analysis from position: 28
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/Ev1e1
function name:  a
number of ops:  35
compiled vars:  !0 = $i, !1 = $s, !2 = $p, !3 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   GENERATOR_CREATE                                         
    8     1        ASSIGN                                                   !0, 0
    9     2        ASSIGN                                                   !1, ''
   10     3      > JMP                                                      ->33
   11     4    >   PRE_INC                                                  !0
   12     5        IS_SMALLER                                               10000, !0
          6      > JMPZ                                                     ~7, ->8
   13     7    > > JMP                                                      ->34
   15     8    > > FE_RESET_R                                       $8      <array>, ->32
          9    > > FE_FETCH_R                                               $8, !2, ->32
   16    10    >   IS_EQUAL                                                 !2, 2
         11      > JMPZ                                                     ~9, ->13
   17    12    > > JMP                                                      ->9
   19    13    >   MOD                                              ~10     !0, 100
         14        IS_EQUAL                                                 ~10, 0
         15      > JMPZ                                                     ~11, ->29
   20    16    >   ECHO                                                     !0
         17        INIT_FCALL                                               'memory_get_usage'
         18        DO_ICALL                                         $12     
         19        ECHO                                                     $12
         20        ECHO                                                     '%0A'
   22    21        INIT_FCALL                                               'str_repeat'
         22        SEND_VAL                                                 '0123456789'
         23        SEND_VAL                                                 100000
         24        DO_ICALL                                         $13     
         25        ASSIGN_OP                                     8          !1, $13
         26      > JMP                                                      ->29
   23    27  E > > CATCH                                       last         'Exception'
   24    28    > > THROW                                         0          !3
   27    29    >   FETCH_DIM_R                                      ~15     !2, 'a'
         30        YIELD                                                    123, ~15
   15    31      > JMP                                                      ->9
         32    >   FE_FREE                                                  $8
   10    33    > > JMPNZ                                                    <true>, ->4
   30    34    > > 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 = 42) Position 1 = 15
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
Found catch point at position: 13
Branch analysis from position: 13
2 jumps found. (Code = 107) Position 1 = 14, Position 2 = -2
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ev1e1
function name:  b
number of ops:  16
compiled vars:  !0 = $sum, !1 = $v, !2 = $k, !3 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   34     0  E >   ASSIGN                                                   !0, 0
   36     1        INIT_METHOD_CALL                                         'a'
          2        DO_FCALL                                      0  $5      
          3      > FE_RESET_R                                       $6      $5, ->9
          4    > > FE_FETCH_R                                       ~7      $6, !1, ->9
          5    >   ASSIGN                                                   !2, ~7
   37     6        ADD                                              ~9      !2, !1
          7        ASSIGN_OP                                     1          !0, ~9
   36     8      > JMP                                                      ->4
          9    >   FE_FREE                                                  $6
   39    10        ECHO                                                     'Done%3A+'
         11        ECHO                                                     !0
         12      > JMP                                                      ->15
   40    13  E > > CATCH                                       last         'Exception'
   41    14    >   ECHO                                                     !3
   43    15    > > RETURN                                                   null

End of function b

End of class A1.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
177.73 ms | 1400 KiB | 17 Q