3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ 'sucesso' => [ 'LAUDO_VISTORIA' => [ 0 => '0027', 2 => '30027', 3 => '0027', ], 'LAUDO' => [ 0 => '0027', 2 => '30027', 3 => '0027', ], 'DADOS_DO_VEICULO' => [ 0 => '0027', 1 => '30027', ] ], 'code' => 201 ]; function r_array_unique($array) { $hasChildren = false; foreach ($array as &$item) { if (is_array($item)) { $hasChildren = true; $item = r_array_unique($item); } } return $hasChildren ? $array : array_unique($array); } var_export(r_array_unique($array));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rQ61I
function name:  (null)
number of ops:  8
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   33     1        INIT_FCALL                                               'var_export'
          2        INIT_FCALL                                               'r_array_unique'
          3        SEND_VAR                                                 !0
          4        DO_FCALL                                      0  $2      
          5        SEND_VAR                                                 $2
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Function r_array_unique:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 3, Position 2 = 12
Branch analysis from position: 3
2 jumps found. (Code = 126) Position 1 = 4, Position 2 = 12
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 11
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 11
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 16
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/rQ61I
function name:  r_array_unique
number of ops:  22
compiled vars:  !0 = $array, !1 = $hasChildren, !2 = $item
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   RECV                                             !0      
   24     1        ASSIGN                                                   !1, <false>
   25     2      > FE_RESET_RW                                      $4      !0, ->12
          3    > > FE_FETCH_RW                                              $4, !2, ->12
   26     4    >   TYPE_CHECK                                  128          !2
          5      > JMPZ                                                     ~5, ->11
   27     6    >   ASSIGN                                                   !1, <true>
   28     7        INIT_FCALL_BY_NAME                                       'r_array_unique'
          8        SEND_VAR_EX                                              !2
          9        DO_FCALL                                      0  $7      
         10        ASSIGN                                                   !2, $7
   25    11    > > JMP                                                      ->3
         12    >   FE_FREE                                                  $4
   31    13      > JMPZ                                                     !1, ->16
         14    >   QM_ASSIGN                                        ~9      !0
         15      > JMP                                                      ->20
         16    >   INIT_FCALL                                               'array_unique'
         17        SEND_VAR                                                 !0
         18        DO_ICALL                                         $10     
         19        QM_ASSIGN                                        ~9      $10
         20    > > RETURN                                                   ~9
   32    21*     > RETURN                                                   null

End of function r_array_unique

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
188.96 ms | 1014 KiB | 16 Q