3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arrayB = array ( 0 => array ( 'order_option_detail' => array ( 0 => array ( 'option_id' => '19', 'sub_option_id' => '57', ), 1 => array ( 'option_id' => '1093', 'sub_option_id' => '57', ), 2 => array ( 'option_id' => '1093', 'sub_option_id' => '3582', ), ), ), 1 => array ( 'order_option_detail' => array ( 0 => array ( 'option_id' => '1', 'sub_option_id' => '2', ), ), ), ); $arrayA = array ( 0 => array ( 'option_id' => '19', 'sub_option_id' => '57', ), 1 => array ( 'option_id' => '1093', 'sub_option_id' => '3582', ), 2 => array ( 'option_id' => '1093', 'sub_option_id' => '57', ), ); $details = array_column($arrayB, 'order_option_detail'); foreach($details as $detail){ // loop the two items. if($detail === $arrayA){ echo "true"; // Do something } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 13
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 13
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 12
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 12
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/TW670
function name:  (null)
number of ops:  15
compiled vars:  !0 = $arrayB, !1 = $arrayA, !2 = $details, !3 = $detail
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   38     1        ASSIGN                                                   !1, <array>
   56     2        INIT_FCALL                                               'array_column'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 'order_option_detail'
          5        DO_ICALL                                         $6      
          6        ASSIGN                                                   !2, $6
   57     7      > FE_RESET_R                                       $8      !2, ->13
          8    > > FE_FETCH_R                                               $8, !3, ->13
   58     9    >   IS_IDENTICAL                                             !3, !1
         10      > JMPZ                                                     ~9, ->12
   59    11    >   ECHO                                                     'true'
   57    12    > > JMP                                                      ->8
         13    >   FE_FREE                                                  $8
   62    14      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.35 ms | 1004 KiB | 14 Q