3v4l.org

run code in 300+ PHP versions simultaneously
<?php $order_ids = array(8,9,10,4,7); $arr = [ [4, 23, 1], [9, 66, 4], [8, 17, 3], ]; foreach($order_ids as $id) { foreach($arr as $record) { if($record[0] == $id) { $newArr[] = $record; break; } } } print_r($newArr);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 15
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 15
Branch analysis from position: 4
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 13
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 13
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 12
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 13
Branch analysis from position: 13
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/YM6Ge
function name:  (null)
number of ops:  20
compiled vars:  !0 = $order_ids, !1 = $arr, !2 = $id, !3 = $record, !4 = $newArr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, <array>
   10     2      > FE_RESET_R                                       $7      !0, ->15
          3    > > FE_FETCH_R                                               $7, !2, ->15
   11     4    > > FE_RESET_R                                       $8      !1, ->13
          5    > > FE_FETCH_R                                               $8, !3, ->13
   12     6    >   FETCH_DIM_R                                      ~9      !3, 0
          7        IS_EQUAL                                                 !2, ~9
          8      > JMPZ                                                     ~10, ->12
   13     9    >   ASSIGN_DIM                                               !4
         10        OP_DATA                                                  !3
   14    11      > JMP                                                      ->13
   11    12    > > JMP                                                      ->5
         13    >   FE_FREE                                                  $8
   10    14      > JMP                                                      ->3
         15    >   FE_FREE                                                  $7
   19    16        INIT_FCALL                                               'print_r'
         17        SEND_VAR                                                 !4
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
185.84 ms | 1395 KiB | 15 Q