3v4l.org

run code in 300+ PHP versions simultaneously
<?php $main_category_currency = 1; $children = array( array('id_category'=>10), array('id_category'=>15), ); function map($child) { return $child['id_category']; } $categories = array_unique(array_merge( array($main_category_currency), array_map("map",$children) ), SORT_NUMERIC); var_dump($categories);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ct3Id
function name:  (null)
number of ops:  20
compiled vars:  !0 = $main_category_currency, !1 = $children, !2 = $categories
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 1
    3     1        ASSIGN                                                   !1, <array>
   11     2        INIT_FCALL                                               'array_unique'
          3        INIT_FCALL                                               'array_merge'
   12     4        INIT_ARRAY                                       ~5      !0
          5        SEND_VAL                                                 ~5
   13     6        INIT_FCALL                                               'array_map'
          7        SEND_VAL                                                 'map'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                         $6      
         10        SEND_VAR                                                 $6
         11        DO_ICALL                                         $7      
         12        SEND_VAR                                                 $7
   14    13        SEND_VAL                                                 1
         14        DO_ICALL                                         $8      
   11    15        ASSIGN                                                   !2, $8
   15    16        INIT_FCALL                                               'var_dump'
         17        SEND_VAR                                                 !2
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

Function map:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ct3Id
function name:  map
number of ops:  4
compiled vars:  !0 = $child
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    9     1        FETCH_DIM_R                                      ~1      !0, 'id_category'
          2      > RETURN                                                   ~1
   10     3*     > RETURN                                                   null

End of function map

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.85 ms | 1387 KiB | 21 Q