3v4l.org

run code in 300+ 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 = 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 = 43) Position 1 = 12, Position 2 = 14
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 14
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/lBKVh
function name:  (null)
number of ops:  20
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, ->15
          3    > > FE_FETCH_R                                               $6, !2, ->15
   17     4    >   INIT_FCALL                                               'preg_match'
          5        CONCAT                                           ~7      '%2F%5Cb', !1
          6        CONCAT                                           ~8      ~7, '%5Cb%2F'
          7        SEND_VAL                                                 ~8
          8        FETCH_DIM_R                                      ~9      !2, 'categories'
          9        SEND_VAL                                                 ~9
         10        DO_ICALL                                         $10     
         11      > JMPZ                                                     $10, ->14
   18    12    >   ASSIGN_DIM                                               !3
         13        OP_DATA                                                  !2
   16    14    > > JMP                                                      ->3
         15    >   FE_FREE                                                  $6
   22    16        INIT_FCALL                                               'var_dump'
         17        SEND_VAR                                                 !3
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.13 ms | 1395 KiB | 17 Q