3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = Array ( "0001" => 80 , "0002" => 71 , "0003" => 99, "0004" => 55.5, "0005" => 66 ); $i=1; function getPosition($id,$array){ foreach($array as $array1){ $keys = array_keys($array); if($keys == $id){ return $array1; } } } echo getPosition('0001',$array).'here';
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UpYl1
function name:  (null)
number of ops:  9
compiled vars:  !0 = $array, !1 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        ASSIGN                                                   !1, 1
   15     2        INIT_FCALL                                               'getposition'
          3        SEND_VAL                                                 '0001'
          4        SEND_VAR                                                 !0
          5        DO_FCALL                                      0  $4      
          6        CONCAT                                           ~5      $4, 'here'
          7        ECHO                                                     ~5
          8      > RETURN                                                   1

Function getposition:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 13
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 13
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 12
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/UpYl1
function name:  getPosition
number of ops:  15
compiled vars:  !0 = $id, !1 = $array, !2 = $array1, !3 = $keys
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    7     2      > FE_RESET_R                                       $4      !1, ->13
          3    > > FE_FETCH_R                                               $4, !2, ->13
    8     4    >   INIT_FCALL                                               'array_keys'
          5        SEND_VAR                                                 !1
          6        DO_ICALL                                         $5      
          7        ASSIGN                                                   !3, $5
    9     8        IS_EQUAL                                                 !3, !0
          9      > JMPZ                                                     ~7, ->12
   10    10    >   FE_FREE                                                  $4
         11      > RETURN                                                   !2
    7    12    > > JMP                                                      ->3
         13    >   FE_FREE                                                  $4
   13    14      > RETURN                                                   null

End of function getposition

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.25 ms | 1399 KiB | 16 Q