3v4l.org

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

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

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
184.4 ms | 1396 KiB | 17 Q