3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [1,2,3,2,4,1,1,2,3]; while ($arr= current($array)) { if ($arr == '2') { echo "key=".key($array).'<br />'; } next($array); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 2
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 2
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 10
Branch analysis from position: 4
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 2
Branch analysis from position: 18
Branch analysis from position: 2
Branch analysis from position: 10
filename:       /in/9QGrF
function name:  (null)
number of ops:  19
compiled vars:  !0 = $array, !1 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1      > JMP                                                      ->13
    4     2    >   IS_EQUAL                                                 !1, '2'
          3      > JMPZ                                                     ~3, ->10
    5     4    >   INIT_FCALL                                               'key'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $4      
          7        CONCAT                                           ~5      'key%3D', $4
          8        CONCAT                                           ~6      ~5, '%3Cbr+%2F%3E'
          9        ECHO                                                     ~6
    7    10    >   INIT_FCALL                                               'next'
         11        SEND_REF                                                 !0
         12        DO_ICALL                                                 
    3    13    >   INIT_FCALL                                               'current'
         14        SEND_VAR                                                 !0
         15        DO_ICALL                                         $8      
         16        ASSIGN                                           ~9      !1, $8
         17      > JMPNZ                                                    ~9, ->2
    8    18    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
179.54 ms | 1395 KiB | 19 Q