3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array( array('name' => 'infotel', 'value' => '+39080123456' ), array('name' => 'location', 'value' => 'Bari') ); $result = array('telephone'=>'NA', 'city'=>'NA'); $arr = array_column($array, 'value', 'name'); array_walk($arr, function(&$v, $k) use (&$result){ if ($k == 'infotel') $result['telephone'] = $v; if ($k == 'location') $result['city'] = $v; }); echo $telephone = $result['telephone']; echo "\n"; echo $city = $result['city'];
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WVnev
function name:  (null)
number of ops:  22
compiled vars:  !0 = $array, !1 = $result, !2 = $arr, !3 = $telephone, !4 = $city
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    7     1        ASSIGN                                                   !1, <array>
    9     2        INIT_FCALL                                               'array_column'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 'value'
          5        SEND_VAL                                                 'name'
          6        DO_ICALL                                         $7      
          7        ASSIGN                                                   !2, $7
   11     8        INIT_FCALL                                               'array_walk'
          9        SEND_REF                                                 !2
         10        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FWVnev%3A11%240'
         11        BIND_LEXICAL                                             ~9, !1
   14    12        SEND_VAL                                                 ~9
         13        DO_ICALL                                                 
   16    14        FETCH_DIM_R                                      ~11     !1, 'telephone'
         15        ASSIGN                                           ~12     !3, ~11
         16        ECHO                                                     ~12
   17    17        ECHO                                                     '%0A'
   18    18        FETCH_DIM_R                                      ~13     !1, 'city'
         19        ASSIGN                                           ~14     !4, ~13
         20        ECHO                                                     ~14
         21      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FWVnev%3A11%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 7
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 11
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
Branch analysis from position: 7
filename:       /in/WVnev
function name:  {closure}
number of ops:  12
compiled vars:  !0 = $v, !1 = $k, !2 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        BIND_STATIC                                              !2
   12     3        IS_EQUAL                                                 !1, 'infotel'
          4      > JMPZ                                                     ~3, ->7
          5    >   ASSIGN_DIM                                               !2, 'telephone'
          6        OP_DATA                                                  !0
   13     7    >   IS_EQUAL                                                 !1, 'location'
          8      > JMPZ                                                     ~5, ->11
          9    >   ASSIGN_DIM                                               !2, 'city'
         10        OP_DATA                                                  !0
   14    11    > > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FWVnev%3A11%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.14 ms | 1396 KiB | 17 Q