3v4l.org

run code in 300+ PHP versions simultaneously
<?php $userdb = array( array( 'uid' => '100', 'name' => 'Sandra Shush', 'pic_square' => 'abc.jpg' ), array( 'uid' => '5465', 'name' => 'Stefanie Mcmohn', 'pic_square' => 'Michael.jpg' ), array( 'uid' => '40489', 'name' => 'Michael', 'pic_square' => 'xyz.jpg' ) ); $search = "Michael"; Foreach($userdb as $key => $arr){ If(preg_grep("/" . $search ."/", $arr)){ $res[] = $userdb[$key]; } } Var_dump($res);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 16
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 16
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 15
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 15
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/BPJBC
function name:  (null)
number of ops:  21
compiled vars:  !0 = $userdb, !1 = $search, !2 = $arr, !3 = $key, !4 = $res
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   20     1        ASSIGN                                                   !1, 'Michael'
   21     2      > FE_RESET_R                                       $7      !0, ->16
          3    > > FE_FETCH_R                                       ~8      $7, !2, ->16
          4    >   ASSIGN                                                   !3, ~8
   22     5        INIT_FCALL                                               'preg_grep'
          6        CONCAT                                           ~10     '%2F', !1
          7        CONCAT                                           ~11     ~10, '%2F'
          8        SEND_VAL                                                 ~11
          9        SEND_VAR                                                 !2
         10        DO_ICALL                                         $12     
         11      > JMPZ                                                     $12, ->15
   23    12    >   FETCH_DIM_R                                      ~14     !0, !3
         13        ASSIGN_DIM                                               !4
         14        OP_DATA                                                  ~14
   21    15    > > JMP                                                      ->3
         16    >   FE_FREE                                                  $7
   27    17        INIT_FCALL                                               'var_dump'
         18        SEND_VAR                                                 !4
         19        DO_ICALL                                                 
         20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.12 ms | 999 KiB | 15 Q