3v4l.org

run code in 500+ PHP versions simultaneously
<?php $array2 = array( array('customer_id' => '01', 'categories' => '',), array('customer_id' => '02', 'categories' => '',), array('customer_id' => '03', 'categories' => '20,26,18',), array('customer_id' => '04', 'categories' => '45,118',), array('customer_id' => '05', 'categories' => '45,118,201,18,55',), ); $like = 18; Foreach($array2 as $val){ If(preg_match("/\b" . $like . "\b/", $val['categories'])){ $res[] = $val; } } Var_dump($res);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 12
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 12
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 11
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 11
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/lBKVh
function name:  (null)
number of ops:  17
compiled vars:  !0 = $array2, !1 = $like, !2 = $val, !3 = $res
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   15     1        ASSIGN                                                       !1, 18
   16     2      > FE_RESET_R                                           $6      !0, ->12
          3    > > FE_FETCH_R                                                   $6, !2, ->12
   17     4    >   CONCAT                                               ~7      '%2F%5Cb', !1
          5        CONCAT                                               ~8      ~7, '%5Cb%2F'
          6        FETCH_DIM_R                                          ~9      !2, 'categories'
          7        FRAMELESS_ICALL_2                preg_match          ~10     ~8, ~9
          8      > JMPZ                                                         ~10, ->11
   18     9    >   ASSIGN_DIM                                                   !3
         10        OP_DATA                                                      !2
   16    11    > > JMP                                                          ->3
         12    >   FE_FREE                                                      $6
   22    13        INIT_FCALL                                                   'var_dump'
         14        SEND_VAR                                                     !3
         15        DO_ICALL                                                     
         16      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
158.79 ms | 2195 KiB | 14 Q