3v4l.org

run code in 300+ PHP versions simultaneously
<?php $newarray = array('489289', '536516', '332833', '536516'); $rockin = array( '489289' => array('536516','value1'), '332833' => array('536516'), ); foreach ($rockin as $array) { foreach ($array as $value) { if (in_array($value, $newarray)) { $key = array_search($array, $rockin); $newarray = array_diff($newarray, array($key)); } } } var_dump($newarray);
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 = 5, Position 2 = 23
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 23
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 22
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 22
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 23
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
filename:       /in/BLk3m
function name:  (null)
number of ops:  30
compiled vars:  !0 = $newarray, !1 = $rockin, !2 = $array, !3 = $value, !4 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        ASSIGN                                                   !1, <array>
   10     2      > FE_RESET_R                                       $7      !1, ->25
          3    > > FE_FETCH_R                                               $7, !2, ->25
   11     4    > > FE_RESET_R                                       $8      !2, ->23
          5    > > FE_FETCH_R                                               $8, !3, ->23
   12     6    >   INIT_FCALL                                               'in_array'
          7        SEND_VAR                                                 !3
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $9      
         10      > JMPZ                                                     $9, ->22
   13    11    >   INIT_FCALL                                               'array_search'
         12        SEND_VAR                                                 !2
         13        SEND_VAR                                                 !1
         14        DO_ICALL                                         $10     
         15        ASSIGN                                                   !4, $10
   14    16        INIT_FCALL                                               'array_diff'
         17        SEND_VAR                                                 !0
         18        INIT_ARRAY                                       ~12     !4
         19        SEND_VAL                                                 ~12
         20        DO_ICALL                                         $13     
         21        ASSIGN                                                   !0, $13
   11    22    > > JMP                                                      ->5
         23    >   FE_FREE                                                  $8
   10    24      > JMP                                                      ->3
         25    >   FE_FREE                                                  $7
   19    26        INIT_FCALL                                               'var_dump'
         27        SEND_VAR                                                 !0
         28        DO_ICALL                                                 
         29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.86 ms | 1401 KiB | 21 Q