3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = ['+5', '+5', '+3', '+3', '+3', '+3', '+5', '+5']; foreach (array_count_values($array) as $value => $count) { if ($count > 1) { unset($array[array_search($value, $array)]); } } var_export(array_sum($array));
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 15
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 15
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 14
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 14
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/M20nU
function name:  (null)
number of ops:  23
compiled vars:  !0 = $array, !1 = $count, !2 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        INIT_FCALL                                               'array_count_values'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $4      
          4      > FE_RESET_R                                       $5      $4, ->15
          5    > > FE_FETCH_R                                       ~6      $5, !1, ->15
          6    >   ASSIGN                                                   !2, ~6
    6     7        IS_SMALLER                                               1, !1
          8      > JMPZ                                                     ~8, ->14
    7     9    >   INIT_FCALL                                               'array_search'
         10        SEND_VAR                                                 !2
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                         $9      
         13        UNSET_DIM                                                !0, $9
    5    14    > > JMP                                                      ->5
         15    >   FE_FREE                                                  $5
   10    16        INIT_FCALL                                               'var_export'
         17        INIT_FCALL                                               'array_sum'
         18        SEND_VAR                                                 !0
         19        DO_ICALL                                         $10     
         20        SEND_VAR                                                 $10
         21        DO_ICALL                                                 
         22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.94 ms | 1395 KiB | 21 Q