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); // if($keys == $id){ // $position = $array1; //} $position .= $keys; } 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/FcgcS
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
   18     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 = 11
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 11
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
filename:       /in/FcgcS
function name:  getPosition
number of ops:  14
compiled vars:  !0 = $id, !1 = $array, !2 = $position, !3 = $array1, !4 = $keys
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                                       $6      !1, ->11
          4    > > FE_FETCH_R                                               $6, !3, ->11
    9     5    >   INIT_FCALL                                               'array_keys'
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                         $7      
          8        ASSIGN                                                   !4, $7
   13     9        ASSIGN_OP                                     8          !2, !4
    8    10      > JMP                                                      ->4
         11    >   FE_FREE                                                  $6
   15    12      > RETURN                                                   !2
   16    13*     > RETURN                                                   null

End of function getposition

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.47 ms | 1399 KiB | 16 Q