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") { 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 = 15
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 5
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
2 jumps found. (Code = 44) Position 1 = 30, Position 2 = 20
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
2 jumps found. (Code = 44) Position 1 = 30, Position 2 = 20
Branch analysis from position: 30
Branch analysis from position: 20
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 13
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 5
Branch analysis from position: 18
Branch analysis from position: 5
filename:       /in/uAT4Q
function name:  (null)
number of ops:  31
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%2FuAT4Q%3A3%240'
    7     1        INIT_DYNAMIC_CALL                                        ~2
          2        DO_FCALL                                      0  $3      
    3     3        ASSIGN                                                   !0, $3
    9     4      > JMP                                                      ->15
   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, ->13
   15    12    > > JMP                                                      ->18
    9    13    >   INIT_METHOD_CALL                                         !0, 'next'
         14        DO_FCALL                                      0          
         15    >   INIT_METHOD_CALL                                         !0, 'valid'
         16        DO_FCALL                                      0  $10     
         17      > JMPNZ                                                    $10, ->5
   19    18    >   ECHO                                                     '-----+second+loop+-----%0A'
   21    19      > JMP                                                      ->27
   22    20    >   INIT_METHOD_CALL                                         !0, 'current'
         21        DO_FCALL                                      0  $11     
         22        ASSIGN                                                   !1, $11
   24    23        CONCAT                                           ~13     !1, '%0A'
         24        ECHO                                                     ~13
   21    25        INIT_METHOD_CALL                                         !0, 'next'
         26        DO_FCALL                                      0          
         27    >   INIT_METHOD_CALL                                         !0, 'valid'
         28        DO_FCALL                                      0  $15     
         29      > JMPNZ                                                    $15, ->20
   25    30    > > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FuAT4Q%3A3%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 161) Position 1 = -2
filename:       /in/uAT4Q
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%2FuAT4Q%3A3%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.22 ms | 1399 KiB | 13 Q