3v4l.org

run code in 300+ PHP versions simultaneously
<?php $list = [ [ 'name' => 'this is items name', 'number' => 1, 'description' => 'this is description', 'id' => 'just some id', ], [ 'name' => 'this is items name2', 'number' => 1, 'description' => 'this is description2', 'id' => 'just some id', ], [ 'name' => 'this is items name3', 'number' => 1, 'description' => 'this is', 'id' => 'just some id', ], ]; $result = []; foreach ($list as $key => $value) { if (preg_match('/\bthis.+?description/', $value["description"])) { $result[$key] = $key; } } print_r($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 14
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 14
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 13
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 13
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/1q163
function name:  (null)
number of ops:  19
compiled vars:  !0 = $list, !1 = $result, !2 = $value, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   23     1        ASSIGN                                                   !1, <array>
   24     2      > FE_RESET_R                                       $6      !0, ->14
          3    > > FE_FETCH_R                                       ~7      $6, !2, ->14
          4    >   ASSIGN                                                   !3, ~7
   25     5        INIT_FCALL                                               'preg_match'
          6        SEND_VAL                                                 '%2F%5Cbthis.%2B%3Fdescription%2F'
          7        FETCH_DIM_R                                      ~9      !2, 'description'
          8        SEND_VAL                                                 ~9
          9        DO_ICALL                                         $10     
         10      > JMPZ                                                     $10, ->13
   26    11    >   ASSIGN_DIM                                               !1, !3
         12        OP_DATA                                                  !3
   24    13    > > JMP                                                      ->3
         14    >   FE_FREE                                                  $6
   30    15        INIT_FCALL                                               'print_r'
         16        SEND_VAR                                                 !1
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.4 ms | 1395 KiB | 17 Q