3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array("ItemNew1.10", "Item2.5", "Item2.2", "Item4.50", "Item2.50", "Aluminum and glass windows.0", "wallmountedrooftop.1", "Aluminum and glass windows.0","ghgh3.2","hgccg.2","wallmountedrooftop.1"); $tempArray = array(); $newArray = array(); foreach($array as $value) { $item = explode(".", $value); $int = filter_var($item[0], $item[1], FILTER_SANITIZE_NUMBER_INT); if(!in_array($int, $tempArray)) { $newArray[] = $value; $tempArray[] = $int; } } print_r($newArray); ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 29
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 29
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 24, Position 2 = 28
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 28
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
filename:       /in/Hj14D
function name:  (null)
number of ops:  34
compiled vars:  !0 = $array, !1 = $tempArray, !2 = $newArray, !3 = $value, !4 = $item, !5 = $int
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, <array>
    5     2        ASSIGN                                                   !2, <array>
    6     3      > FE_RESET_R                                       $9      !0, ->29
          4    > > FE_FETCH_R                                               $9, !3, ->29
    7     5    >   INIT_FCALL                                               'explode'
          6        SEND_VAL                                                 '.'
          7        SEND_VAR                                                 !3
          8        DO_ICALL                                         $10     
          9        ASSIGN                                                   !4, $10
    8    10        INIT_FCALL                                               'filter_var'
         11        FETCH_DIM_R                                      ~12     !4, 0
         12        SEND_VAL                                                 ~12
         13        FETCH_DIM_R                                      ~13     !4, 1
         14        SEND_VAL                                                 ~13
         15        SEND_VAL                                                 519
         16        DO_ICALL                                         $14     
         17        ASSIGN                                                   !5, $14
    9    18        INIT_FCALL                                               'in_array'
         19        SEND_VAR                                                 !5
         20        SEND_VAR                                                 !1
         21        DO_ICALL                                         $16     
         22        BOOL_NOT                                         ~17     $16
         23      > JMPZ                                                     ~17, ->28
   10    24    >   ASSIGN_DIM                                               !2
         25        OP_DATA                                                  !3
   11    26        ASSIGN_DIM                                               !1
         27        OP_DATA                                                  !5
    6    28    > > JMP                                                      ->4
         29    >   FE_FREE                                                  $9
   14    30        INIT_FCALL                                               'print_r'
         31        SEND_VAR                                                 !2
         32        DO_ICALL                                                 
   15    33      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.12 ms | 1396 KiB | 21 Q