3v4l.org

run code in 300+ PHP versions simultaneously
<?php function arr_unique($arr) { sort($arr); $curr = $arr[0]; $uni_arr[] = $arr[0]; for($i=0; $i<count($arr);$i++){ if($curr != $arr[$i]) { $uni_arr[] = $arr[$i]; $curr = $arr[$i]; } } return $uni_arr; } var_export(arr_unique([null, '', .0, [], false, null, 0, '0.0', -.1, "\0", false, []]));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kdRZQ
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_FCALL                                               'var_export'
          1        INIT_FCALL                                               'arr_unique'
          2        SEND_VAL                                                 <array>
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
          6      > RETURN                                                   1

Function arr_unique:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
2 jumps found. (Code = 44) Position 1 = 23, Position 2 = 11
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 19
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 23, Position 2 = 11
Branch analysis from position: 23
Branch analysis from position: 11
Branch analysis from position: 19
filename:       /in/kdRZQ
function name:  arr_unique
number of ops:  25
compiled vars:  !0 = $arr, !1 = $curr, !2 = $uni_arr, !3 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'sort'
          2        SEND_REF                                                 !0
          3        DO_ICALL                                                 
    5     4        FETCH_DIM_R                                      ~5      !0, 0
          5        ASSIGN                                                   !1, ~5
    6     6        FETCH_DIM_R                                      ~8      !0, 0
          7        ASSIGN_DIM                                               !2
          8        OP_DATA                                                  ~8
    7     9        ASSIGN                                                   !3, 0
         10      > JMP                                                      ->20
    8    11    >   FETCH_DIM_R                                      ~10     !0, !3
         12        IS_NOT_EQUAL                                             !1, ~10
         13      > JMPZ                                                     ~11, ->19
    9    14    >   FETCH_DIM_R                                      ~13     !0, !3
         15        ASSIGN_DIM                                               !2
         16        OP_DATA                                                  ~13
   10    17        FETCH_DIM_R                                      ~14     !0, !3
         18        ASSIGN                                                   !1, ~14
    7    19    >   PRE_INC                                                  !3
         20    >   COUNT                                            ~17     !0
         21        IS_SMALLER                                               !3, ~17
         22      > JMPNZ                                                    ~18, ->11
   13    23    > > RETURN                                                   !2
   14    24*     > RETURN                                                   null

End of function arr_unique

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
127.94 ms | 1009 KiB | 16 Q