3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array("Painted concrete Walls .1", "Concrete steps with steel rainings.0", "1 Steel emergency staircase.0", "1 A/c condenser unit (wall mounted/rooftop).1", "1 Dust to dawn lighting fixture.1"); $tempArray = array(); $newArray = array(); foreach($array as $value) { $item = explode(".", $value); $int = filter_var($item[0], 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 = 27
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 27
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 26
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 26
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
filename:       /in/ZpM1S
function name:  (null)
number of ops:  32
compiled vars:  !0 = $array, !1 = $tempArray, !2 = $newArray, !3 = $value, !4 = $item, !5 = $int
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        ASSIGN                                                   !1, <array>
    6     2        ASSIGN                                                   !2, <array>
    7     3      > FE_RESET_R                                       $9      !0, ->27
          4    > > FE_FETCH_R                                               $9, !3, ->27
    8     5    >   INIT_FCALL                                               'explode'
          6        SEND_VAL                                                 '.'
          7        SEND_VAR                                                 !3
          8        DO_ICALL                                         $10     
          9        ASSIGN                                                   !4, $10
    9    10        INIT_FCALL                                               'filter_var'
         11        FETCH_DIM_R                                      ~12     !4, 0
         12        SEND_VAL                                                 ~12
         13        SEND_VAL                                                 519
         14        DO_ICALL                                         $13     
         15        ASSIGN                                                   !5, $13
   10    16        INIT_FCALL                                               'in_array'
         17        SEND_VAR                                                 !5
         18        SEND_VAR                                                 !1
         19        DO_ICALL                                         $15     
         20        BOOL_NOT                                         ~16     $15
         21      > JMPZ                                                     ~16, ->26
   11    22    >   ASSIGN_DIM                                               !2
         23        OP_DATA                                                  !3
   12    24        ASSIGN_DIM                                               !1
         25        OP_DATA                                                  !5
    7    26    > > JMP                                                      ->4
         27    >   FE_FREE                                                  $9
   15    28        INIT_FCALL                                               'print_r'
         29        SEND_VAR                                                 !2
         30        DO_ICALL                                                 
   16    31      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.71 ms | 1396 KiB | 21 Q