3v4l.org

run code in 300+ PHP versions simultaneously
<?php function utils_removeDuplicates($str, $delimiter = ',') { if($str != '') { $str = implode($delimiter,array_unique(explode($delimiter, $str))); } return $str; } $data = "88, 99, 99,99, 100"; echo utils_removeDuplicates($data); //$a = preg_split( '/[, ]+/', $data, -1, PREG_SPLIT_NO_EMPTY );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5N81m
function name:  (null)
number of ops:  6
compiled vars:  !0 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   ASSIGN                                                   !0, '88%2C+99%2C+99%2C99%2C+100'
   11     1        INIT_FCALL                                               'utils_removeduplicates'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0  $2      
          4        ECHO                                                     $2
   12     5      > RETURN                                                   1

Function utils_removeduplicates:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 16
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/5N81m
function name:  utils_removeDuplicates
number of ops:  18
compiled vars:  !0 = $str, !1 = $delimiter
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      '%2C'
    3     2        IS_NOT_EQUAL                                             !0, ''
          3      > JMPZ                                                     ~2, ->16
    4     4    >   INIT_FCALL                                               'implode'
          5        SEND_VAR                                                 !1
          6        INIT_FCALL                                               'array_unique'
          7        INIT_FCALL                                               'explode'
          8        SEND_VAR                                                 !1
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $3      
         11        SEND_VAR                                                 $3
         12        DO_ICALL                                         $4      
         13        SEND_VAR                                                 $4
         14        DO_ICALL                                         $5      
         15        ASSIGN                                                   !0, $5
    7    16    > > RETURN                                                   !0
    8    17*     > RETURN                                                   null

End of function utils_removeduplicates

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.67 ms | 1389 KiB | 20 Q