3v4l.org

run code in 300+ PHP versions simultaneously
<?php $ar = [ 0 => ['details' => '{"E":{"id": 3}}'], 1 => ['details' => '{"V":{"id": 8}}'], 2 => ['details' => '{"F":{"id": 5}}'], 3 => ['details' => '{"D":{"id": 1}}'], ]; $ar = array_map(function ($value) { return array_values(json_decode($value['details'], true))[0]['id']; }, $ar); print_r($ar);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/koXee
function name:  (null)
number of ops:  11
compiled vars:  !0 = $ar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   10     1        INIT_FCALL                                               'array_map'
          2        DECLARE_LAMBDA_FUNCTION                          ~2      [0]
   12     3        SEND_VAL                                                 ~2
          4        SEND_VAR                                                 !0
   10     5        DO_ICALL                                         $3      
          6        ASSIGN                                                   !0, $3
   14     7        INIT_FCALL                                               'print_r'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                                 
         10      > 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/koXee
function name:  {closure}
number of ops:  13
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   11     1        INIT_FCALL                                               'array_values'
          2        INIT_FCALL                                               'json_decode'
          3        FETCH_DIM_R                                      ~1      !0, 'details'
          4        SEND_VAL                                                 ~1
          5        SEND_VAL                                                 <true>
          6        DO_ICALL                                         $2      
          7        SEND_VAR                                                 $2
          8        DO_ICALL                                         $3      
          9        FETCH_DIM_R                                      ~4      $3, 0
         10        FETCH_DIM_R                                      ~5      ~4, 'id'
         11      > RETURN                                                   ~5
   12    12*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
209.92 ms | 1003 KiB | 17 Q