3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = [ 'foo', 'foo', 'bar', 'baz', 'baz' ]; $arr2 = []; foreach ($arr as $v) { $lower = mb_strtolower($v, 'utf-8'); foreach ($arr2 as $v2) { $lower2 = mb_strtolower($v2, 'utf-8'); if ($lower === $lower2) { continue 2; } } $arr2[] = $v; } var_dump($arr2);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 25
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 25
Branch analysis from position: 4
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 21
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 21
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 20
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 21
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
filename:       /in/HHgts
function name:  (null)
number of ops:  30
compiled vars:  !0 = $arr, !1 = $arr2, !2 = $v, !3 = $lower, !4 = $v2, !5 = $lower2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   11     1        ASSIGN                                                   !1, <array>
   12     2      > FE_RESET_R                                       $8      !0, ->25
          3    > > FE_FETCH_R                                               $8, !2, ->25
   13     4    >   INIT_FCALL                                               'mb_strtolower'
          5        SEND_VAR                                                 !2
          6        SEND_VAL                                                 'utf-8'
          7        DO_ICALL                                         $9      
          8        ASSIGN                                                   !3, $9
   14     9      > FE_RESET_R                                       $11     !1, ->21
         10    > > FE_FETCH_R                                               $11, !4, ->21
   15    11    >   INIT_FCALL                                               'mb_strtolower'
         12        SEND_VAR                                                 !4
         13        SEND_VAL                                                 'utf-8'
         14        DO_ICALL                                         $12     
         15        ASSIGN                                                   !5, $12
   16    16        IS_IDENTICAL                                             !3, !5
         17      > JMPZ                                                     ~14, ->20
   17    18    >   FE_FREE                                                  $11
         19      > JMP                                                      ->3
   14    20    > > JMP                                                      ->10
         21    >   FE_FREE                                                  $11
   21    22        ASSIGN_DIM                                               !1
         23        OP_DATA                                                  !2
   12    24      > JMP                                                      ->3
         25    >   FE_FREE                                                  $8
   24    26        INIT_FCALL                                               'var_dump'
         27        SEND_VAR                                                 !1
         28        DO_ICALL                                                 
         29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.48 ms | 1396 KiB | 17 Q