3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = array(1,2,3,4,5,6,7,8,9,10); $key = 2; $a = array(1,2,'foo'=>3,4,5,6,7,8,9,10); $key = '2'; foreach (new LimitIterator(new CallbackFilterIterator(new InfiniteIterator(new ArrayIterator($a)), function($v, $k) use ($key) { static $good = false; $good |= $k === $key; return $good; }), 0, count($a)) as $k => $v) { echo "$k => $v\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 23, Position 2 = 31
Branch analysis from position: 23
2 jumps found. (Code = 78) Position 1 = 24, Position 2 = 31
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 31
filename:       /in/qeG9A
function name:  (null)
number of ops:  33
compiled vars:  !0 = $a, !1 = $key, !2 = $v, !3 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        ASSIGN                                                   !1, 2
    4     2        ASSIGN                                                   !0, <array>
    5     3        ASSIGN                                                   !1, '2'
    6     4        NEW                                              $8      'LimitIterator'
          5        NEW                                              $9      'CallbackFilterIterator'
          6        NEW                                              $10     'InfiniteIterator'
          7        NEW                                              $11     'ArrayIterator'
          8        SEND_VAR_EX                                              !0
          9        DO_FCALL                                      0          
         10        SEND_VAR_NO_REF_EX                                       $11
         11        DO_FCALL                                      0          
         12        SEND_VAR_NO_REF_EX                                       $10
         13        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FqeG9A%3A6%240'
         14        BIND_LEXICAL                                             ~14, !1
         15        SEND_VAL_EX                                              ~14
         16        DO_FCALL                                      0          
         17        SEND_VAR_NO_REF_EX                                       $9
         18        SEND_VAL_EX                                              0
         19        COUNT                                            ~16     !0
         20        SEND_VAL_EX                                              ~16
         21        DO_FCALL                                      0          
         22      > FE_RESET_R                                       $18     $8, ->31
         23    > > FE_FETCH_R                                       ~19     $18, !2, ->31
         24    >   ASSIGN                                                   !3, ~19
    7    25        ROPE_INIT                                     4  ~22     !3
         26        ROPE_ADD                                      1  ~22     ~22, '+%3D%3E+'
         27        ROPE_ADD                                      2  ~22     ~22, !2
         28        ROPE_END                                      3  ~21     ~22, '%0A'
         29        ECHO                                                     ~21
    6    30      > JMP                                                      ->23
         31    >   FE_FREE                                                  $18
    8    32      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FqeG9A%3A6%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qeG9A
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $v, !1 = $k, !2 = $key, !3 = $good
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        BIND_STATIC                                              !2
          3        BIND_STATIC                                              !3
          4        IS_IDENTICAL                                     ~4      !1, !2
          5        ASSIGN_OP                                     9          !3, ~4
          6      > RETURN                                                   !3
          7*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FqeG9A%3A6%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.04 ms | 1403 KiB | 13 Q