3v4l.org

run code in 300+ PHP versions simultaneously
<?php $iterator = (function () { yield "a"; yield "b"; yield "c"; })(); for (true; $iterator->valid(); $iterator->next()) { $value = $iterator->current(); print $value . "\n"; if ($value === "b") { $iterator->next(); break; } } print "----- second loop -----\n"; for (true; $iterator->valid(); $iterator->next()) { $value = $iterator->current(); print $value . "\n"; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 5
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
2 jumps found. (Code = 44) Position 1 = 32, Position 2 = 22
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
2 jumps found. (Code = 44) Position 1 = 32, Position 2 = 22
Branch analysis from position: 32
Branch analysis from position: 22
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 15
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 5
Branch analysis from position: 20
Branch analysis from position: 5
filename:       /in/T1KWu
function name:  (null)
number of ops:  33
compiled vars:  !0 = $iterator, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FT1KWu%3A3%240'
    7     1        INIT_DYNAMIC_CALL                                        ~2
          2        DO_FCALL                                      0  $3      
    3     3        ASSIGN                                                   !0, $3
    9     4      > JMP                                                      ->17
   10     5    >   INIT_METHOD_CALL                                         !0, 'current'
          6        DO_FCALL                                      0  $5      
          7        ASSIGN                                                   !1, $5
   12     8        CONCAT                                           ~7      !1, '%0A'
          9        ECHO                                                     ~7
   14    10        IS_IDENTICAL                                             !1, 'b'
         11      > JMPZ                                                     ~8, ->15
   15    12    >   INIT_METHOD_CALL                                         !0, 'next'
         13        DO_FCALL                                      0          
   16    14      > JMP                                                      ->20
    9    15    >   INIT_METHOD_CALL                                         !0, 'next'
         16        DO_FCALL                                      0          
         17    >   INIT_METHOD_CALL                                         !0, 'valid'
         18        DO_FCALL                                      0  $11     
         19      > JMPNZ                                                    $11, ->5
   20    20    >   ECHO                                                     '-----+second+loop+-----%0A'
   22    21      > JMP                                                      ->29
   23    22    >   INIT_METHOD_CALL                                         !0, 'current'
         23        DO_FCALL                                      0  $12     
         24        ASSIGN                                                   !1, $12
   25    25        CONCAT                                           ~14     !1, '%0A'
         26        ECHO                                                     ~14
   22    27        INIT_METHOD_CALL                                         !0, 'next'
         28        DO_FCALL                                      0          
         29    >   INIT_METHOD_CALL                                         !0, 'valid'
         30        DO_FCALL                                      0  $16     
         31      > JMPNZ                                                    $16, ->22
   26    32    > > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FT1KWu%3A3%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 161) Position 1 = -2
filename:       /in/T1KWu
function name:  {closure}
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   GENERATOR_CREATE                                         
    4     1        YIELD                                                    'a'
    5     2        YIELD                                                    'b'
    6     3        YIELD                                                    'c'
    7     4      > GENERATOR_RETURN                                         

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.14 ms | 1399 KiB | 13 Q