3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.11 ms | 1396 KiB | 17 Q