3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getNumsOdd(array $nums) { foreach($nums as $key => $num) { if ($num % 2) { yield $key => $num; } } } foreach(getNumsOdd([1,3,4,5,6]) as $key => $num) { echo $key . '=>' . $num.PHP_EOL; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 11
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 11
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
filename:       /in/ZEsil
function name:  (null)
number of ops:  13
compiled vars:  !0 = $num, !1 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                               'getnumsodd'
          1        SEND_VAL                                                 <array>
          2        DO_FCALL                                      0  $2      
          3      > FE_RESET_R                                       $3      $2, ->11
          4    > > FE_FETCH_R                                       ~4      $3, !0, ->11
          5    >   ASSIGN                                                   !1, ~4
   12     6        CONCAT                                           ~6      !1, '%3D%3E'
          7        CONCAT                                           ~7      ~6, !0
          8        CONCAT                                           ~8      ~7, '%0A'
          9        ECHO                                                     ~8
   11    10      > JMP                                                      ->4
         11    >   FE_FREE                                                  $3
   13    12      > RETURN                                                   1

Function getnumsodd:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 9
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 9
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 = 3
Branch analysis from position: 3
Branch analysis from position: 8
Branch analysis from position: 9
1 jumps found. (Code = 161) Position 1 = -2
Branch analysis from position: 9
filename:       /in/ZEsil
function name:  getNumsOdd
number of ops:  11
compiled vars:  !0 = $nums, !1 = $num, !2 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        GENERATOR_CREATE                                         
    4     2      > FE_RESET_R                                       $3      !0, ->9
          3    > > FE_FETCH_R                                       ~4      $3, !1, ->9
          4    >   ASSIGN                                                   !2, ~4
    5     5        MOD                                              ~6      !1, 2
          6      > JMPZ                                                     ~6, ->8
    6     7    >   YIELD                                                    !1, !2
    4     8    > > JMP                                                      ->3
          9    >   FE_FREE                                                  $3
    9    10      > GENERATOR_RETURN                                         

End of function getnumsodd

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.5 ms | 1390 KiB | 14 Q