3v4l.org

run code in 300+ PHP versions simultaneously
<?php $lines = [ "1849781487", "1838433023", "1855575775", "1825054296", "1868575843", "1800003509", "1781354776", "1650813649", "1762706044", "1688111114", "1669462381", "1632164916" ]; $searchword = '18'; $matches = array(); foreach($lines as $k=>$v) { if(preg_match("/^$searchword/i", $v)) { $matches[$k] = $v; } } print_r($matches);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 17
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 17
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 16
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 16
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/5mWSi
function name:  (null)
number of ops:  22
compiled vars:  !0 = $lines, !1 = $searchword, !2 = $matches, !3 = $v, !4 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   19     1        ASSIGN                                                   !1, '18'
   21     2        ASSIGN                                                   !2, <array>
   22     3      > FE_RESET_R                                       $8      !0, ->17
          4    > > FE_FETCH_R                                       ~9      $8, !3, ->17
          5    >   ASSIGN                                                   !4, ~9
   23     6        INIT_FCALL                                               'preg_match'
          7        ROPE_INIT                                     3  ~12     '%2F%5E'
          8        ROPE_ADD                                      1  ~12     ~12, !1
          9        ROPE_END                                      2  ~11     ~12, '%2Fi'
         10        SEND_VAL                                                 ~11
         11        SEND_VAR                                                 !3
         12        DO_ICALL                                         $14     
         13      > JMPZ                                                     $14, ->16
   24    14    >   ASSIGN_DIM                                               !2, !4
         15        OP_DATA                                                  !3
   22    16    > > JMP                                                      ->4
         17    >   FE_FREE                                                  $8
   28    18        INIT_FCALL                                               'print_r'
         19        SEND_VAR                                                 !2
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.78 ms | 1387 KiB | 17 Q