3v4l.org

run code in 500+ PHP versions simultaneously
<?php $arr = [ 10 => [ 'fieldId' => 'OR', 'type' => 'T', 'value' => 'Pos', ], 11 => [ 'fieldId' => 'ORStreet', 'type' => 'TEXT', 'value' => 'Postbus 52', ], 12 => [ 'fieldId' => 'OR', 'type' => 'T', 'value' => 'Pos', ] ]; $index = array_flip(array_map(function($val){ return $val["fieldId"]; }, $arr)); echo $index["ORStreet"];
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1eLOG
function name:  (null)
number of ops:  13
compiled vars:  !0 = $arr, !1 = $index
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, <array>
   20     1        INIT_FCALL                                                   'array_flip'
          2        INIT_FCALL                                                   'array_map'
          3        DECLARE_LAMBDA_FUNCTION                              ~3      [0]
   22     4        SEND_VAL                                                     ~3
          5        SEND_VAR                                                     !0
   20     6        DO_ICALL                                             $4      
   22     7        SEND_VAR                                                     $4
   20     8        DO_ICALL                                             $5      
          9        ASSIGN                                                       !1, $5
   23    10        FETCH_DIM_R                                          ~7      !1, 'ORStreet'
         11        ECHO                                                         ~7
         12      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1eLOG
function name:  {closure:/in/1eLOG:20}
number of ops:  4
compiled vars:  !0 = $val
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   20     0  E >   RECV                                                 !0      
   21     1        FETCH_DIM_R                                          ~1      !0, 'fieldId'
          2      > RETURN                                                       ~1
   22     3*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
162.06 ms | 2117 KiB | 15 Q