3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input_arr= array( 0=>array("india0","srilanka1","pakistan0","banglades0"), 1=>array("india1","srilanka1","pakistan1","bangladesh1"), 2=>array("india2","srilanka2","pakistan2","bangladesh2"), 3=>array("india3","srilanka3","pakistan3","bangladesh3"), 4=>array("india4","srilanka4","pakistan4","bangladesh4"), 5=>array("india5","srilanka5","pakistan5","bangladesh5"), ); $result_arr= array(array()); for($i=0;$i<sizeof($input_arr);$i++) { if(in_array("banglades0",$input_arr[$i])) if(in_array("india0",$input_arr[$i])) $result_arr[$i] = $input_arr[$i]; } print_r($result_arr);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
2 jumps found. (Code = 44) Position 1 = 23, Position 2 = 4
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 19
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 19
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 23, Position 2 = 4
Branch analysis from position: 23
Branch analysis from position: 4
Branch analysis from position: 19
Branch analysis from position: 19
filename:       /in/RGlpe
function name:  (null)
number of ops:  27
compiled vars:  !0 = $input_arr, !1 = $result_arr, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   10     1        ASSIGN                                                   !1, <array>
   11     2        ASSIGN                                                   !2, 0
          3      > JMP                                                      ->20
   13     4    >   INIT_FCALL                                               'in_array'
          5        SEND_VAL                                                 'banglades0'
          6        FETCH_DIM_R                                      ~6      !0, !2
          7        SEND_VAL                                                 ~6
          8        DO_ICALL                                         $7      
          9      > JMPZ                                                     $7, ->19
   14    10    >   INIT_FCALL                                               'in_array'
         11        SEND_VAL                                                 'india0'
         12        FETCH_DIM_R                                      ~8      !0, !2
         13        SEND_VAL                                                 ~8
         14        DO_ICALL                                         $9      
         15      > JMPZ                                                     $9, ->19
   15    16    >   FETCH_DIM_R                                      ~11     !0, !2
         17        ASSIGN_DIM                                               !1, !2
         18        OP_DATA                                                  ~11
   11    19    >   PRE_INC                                                  !2
         20    >   COUNT                                            ~13     !0
         21        IS_SMALLER                                               !2, ~13
         22      > JMPNZ                                                    ~14, ->4
   17    23    >   INIT_FCALL                                               'print_r'
         24        SEND_VAR                                                 !1
         25        DO_ICALL                                                 
         26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.43 ms | 1396 KiB | 17 Q