3v4l.org

run code in 300+ PHP versions simultaneously
<?php $subregion = [ [ "subregion_id" => "8", "subregion_name" => "NORTH_AMERICA", "subregion_abbr" => "US" ], [ "subregion_id" => "9", "subregion_name" => "NORTH_AMERICA", "subregion_abbr" => "CA" ], [ "subregion_id" => "6", "subregion_name" => "WE", "subregion_abbr" => "South" ], [ "subregion_id" => "0", "subregion_name" => null, "subregion_abbr" => null ], [ "subregion_id" => "5", "subregion_name" => "WE", "subregion_abbr" => "North" ], [ "subregion_id" => "0", "subregion_name" => null, "subregion_abbr" => null ] ]; $unique = array_map("unserialize", array_unique(array_map("serialize", $subregion))); $unique = array_map(function($v) { return array_filter($v, 'is_not_null'); }, $unique); print_r($unique); function is_not_null($var) { return null !== $var; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dQkaE
function name:  (null)
number of ops:  23
compiled vars:  !0 = $subregion, !1 = $unique
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   36     1        INIT_FCALL                                               'array_map'
          2        SEND_VAL                                                 'unserialize'
          3        INIT_FCALL                                               'array_unique'
          4        INIT_FCALL                                               'array_map'
          5        SEND_VAL                                                 'serialize'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $3      
          8        SEND_VAR                                                 $3
          9        DO_ICALL                                         $4      
         10        SEND_VAR                                                 $4
         11        DO_ICALL                                         $5      
         12        ASSIGN                                                   !1, $5
   37    13        INIT_FCALL                                               'array_map'
         14        DECLARE_LAMBDA_FUNCTION                          ~7      [0]
         15        SEND_VAL                                                 ~7
         16        SEND_VAR                                                 !1
         17        DO_ICALL                                         $8      
         18        ASSIGN                                                   !1, $8
   39    19        INIT_FCALL                                               'print_r'
         20        SEND_VAR                                                 !1
         21        DO_ICALL                                                 
   44    22      > 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/dQkaE
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   37     0  E >   RECV                                             !0      
          1        INIT_FCALL                                               'array_filter'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 'is_not_null'
          4        DO_ICALL                                         $1      
          5      > RETURN                                                   $1
          6*     > RETURN                                                   null

End of Dynamic Function 0

Function is_not_null:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dQkaE
function name:  is_not_null
number of ops:  4
compiled vars:  !0 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   41     0  E >   RECV                                             !0      
   43     1        TYPE_CHECK                                  1020  ~1      !0
          2      > RETURN                                                   ~1
   44     3*     > RETURN                                                   null

End of function is_not_null

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.55 ms | 1004 KiB | 17 Q