3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getFor($i) { $srt=""; $array = [1,2,3,2,4,1,1,2,3]; while ($arr= current($array)) { if ($arr == '$i') { $srt.= "key=".key($array).'<br />'; } next($array); } } echo getFor(1);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3bgEN
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL                                               'getfor'
          1        SEND_VAL                                                 1
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4      > RETURN                                                   1

Function getfor:
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 = 20, Position 2 = 4
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 12
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 4
Branch analysis from position: 20
Branch analysis from position: 4
Branch analysis from position: 12
filename:       /in/3bgEN
function name:  getFor
number of ops:  21
compiled vars:  !0 = $i, !1 = $srt, !2 = $array, !3 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    4     1        ASSIGN                                                   !1, ''
    5     2        ASSIGN                                                   !2, <array>
    6     3      > JMP                                                      ->15
    7     4    >   IS_EQUAL                                                 !3, '%24i'
          5      > JMPZ                                                     ~6, ->12
    8     6    >   INIT_FCALL                                               'key'
          7        SEND_VAR                                                 !2
          8        DO_ICALL                                         $7      
          9        CONCAT                                           ~8      'key%3D', $7
         10        CONCAT                                           ~9      ~8, '%3Cbr+%2F%3E'
         11        ASSIGN_OP                                     8          !1, ~9
   10    12    >   INIT_FCALL                                               'next'
         13        SEND_REF                                                 !2
         14        DO_ICALL                                                 
    6    15    >   INIT_FCALL                                               'current'
         16        SEND_VAR                                                 !2
         17        DO_ICALL                                         $12     
         18        ASSIGN                                           ~13     !3, $12
         19      > JMPNZ                                                    ~13, ->4
   12    20    > > RETURN                                                   null

End of function getfor

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
194.9 ms | 1399 KiB | 20 Q