3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = 'somenametofind|alinktoimages_icon_047_00.png|some-text'; $searched = array("some-text", "047"); foreach ($searched as $s) { $b = is_numeric($s) ? '\D' : '\b'; if (preg_match("/$b$s$b/i", $string) ) { echo "found $s\n"; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 27
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 27
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 10
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 26
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 26
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 26
Branch analysis from position: 22
Branch analysis from position: 26
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
filename:       /in/ALlvv
function name:  (null)
number of ops:  29
compiled vars:  !0 = $string, !1 = $searched, !2 = $s, !3 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'somenametofind%7Calinktoimages_icon_047_00.png%7Csome-text'
    4     1        ASSIGN                                                   !1, <array>
    5     2      > FE_RESET_R                                       $6      !1, ->27
          3    > > FE_FETCH_R                                               $6, !2, ->27
    6     4    >   INIT_FCALL                                               'is_numeric'
          5        SEND_VAR                                                 !2
          6        DO_ICALL                                         $7      
          7      > JMPZ                                                     $7, ->10
          8    >   QM_ASSIGN                                        ~8      '%5CD'
          9      > JMP                                                      ->11
         10    >   QM_ASSIGN                                        ~8      '%5Cb'
         11    >   ASSIGN                                                   !3, ~8
    7    12        INIT_FCALL                                               'preg_match'
         13        ROPE_INIT                                     5  ~11     '%2F'
         14        ROPE_ADD                                      1  ~11     ~11, !3
         15        ROPE_ADD                                      2  ~11     ~11, !2
         16        ROPE_ADD                                      3  ~11     ~11, !3
         17        ROPE_END                                      4  ~10     ~11, '%2Fi'
         18        SEND_VAL                                                 ~10
         19        SEND_VAR                                                 !0
         20        DO_ICALL                                         $14     
         21      > JMPZ                                                     $14, ->26
    8    22    >   ROPE_INIT                                     3  ~16     'found+'
         23        ROPE_ADD                                      1  ~16     ~16, !2
         24        ROPE_END                                      2  ~15     ~16, '%0A'
         25        ECHO                                                     ~15
    5    26    > > JMP                                                      ->3
         27    >   FE_FREE                                                  $6
   10    28      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
135.33 ms | 1002 KiB | 15 Q