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){ $position = ''; foreach($array as $array1){ $keys = array_keys($array); foreach($keys as $key){ if($keys == $id){ $position = $array1; } } } return $position; } echo getPosition('0001',$array).'here';
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/m0DU2
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
   21     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 = 4, Position 2 = 17
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 17
Branch analysis from position: 5
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 15
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 15
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 14
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 14
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 15
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/m0DU2
function name:  getPosition
number of ops:  20
compiled vars:  !0 = $id, !1 = $array, !2 = $position, !3 = $array1, !4 = $keys, !5 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    7     2        ASSIGN                                                   !2, ''
    8     3      > FE_RESET_R                                       $7      !1, ->17
          4    > > FE_FETCH_R                                               $7, !3, ->17
    9     5    >   INIT_FCALL                                               'array_keys'
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                         $8      
          8        ASSIGN                                                   !4, $8
   10     9      > FE_RESET_R                                       $10     !4, ->15
         10    > > FE_FETCH_R                                               $10, !5, ->15
   11    11    >   IS_EQUAL                                                 !4, !0
         12      > JMPZ                                                     ~11, ->14
   12    13    >   ASSIGN                                                   !2, !3
   10    14    > > JMP                                                      ->10
         15    >   FE_FREE                                                  $10
    8    16      > JMP                                                      ->4
         17    >   FE_FREE                                                  $7
   17    18      > RETURN                                                   !2
   19    19*     > RETURN                                                   null

End of function getposition

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.04 ms | 1398 KiB | 16 Q