3v4l.org

run code in 300+ PHP versions simultaneously
<?php $main_category_currency = 1; $children = array( array('id_category'=>10), array('id_category'=>15), ); $categories = array_unique(array_merge( array($main_category_currency), array_map( function($child) { return $child['id_category']; }, $children ) ), SORT_NUMERIC); var_dump($categories);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mqKke
function name:  (null)
number of ops:  21
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>
    7     2        INIT_FCALL                                               'array_unique'
          3        INIT_FCALL                                               'array_merge'
    8     4        INIT_ARRAY                                       ~5      !0
          5        SEND_VAL                                                 ~5
    9     6        INIT_FCALL                                               'array_map'
   10     7        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FmqKke%3A10%240'
   13     8        SEND_VAL                                                 ~6
   14     9        SEND_VAR                                                 !1
         10        DO_ICALL                                         $7      
         11        SEND_VAR                                                 $7
         12        DO_ICALL                                         $8      
         13        SEND_VAR                                                 $8
   16    14        SEND_VAL                                                 1
         15        DO_ICALL                                         $9      
    7    16        ASSIGN                                                   !2, $9
   17    17        INIT_FCALL                                               'var_dump'
         18        SEND_VAR                                                 !2
         19        DO_ICALL                                                 
         20      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FmqKke%3A10%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mqKke
function name:  {closure}
number of ops:  4
compiled vars:  !0 = $child
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   12     1        FETCH_DIM_R                                      ~1      !0, 'id_category'
          2      > RETURN                                                   ~1
   13     3*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FmqKke%3A10%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.26 ms | 1395 KiB | 21 Q