3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array( 'text 1 2 and 3 text', 'text 3 9 25 text', 'text 9 25 48 text', ); foreach ($array as $color) { echo "\n---\n$color"; echo "\n\t" , preg_match('~\b[1-8]\b~', $color, $out) ? "checked (satisfied by {$out[0]})" : 'not found'; echo "\n\tChad says: " , (strpos($color,'1') || strpos($color,'2') || strpos($color,'3') || strpos($color,'4') || strpos($color,'5') || strpos($color,'6') || strpos($color,'7') || strpos($color,'8') ? 'found' : 'not found'); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 74
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 74
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 19
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
2 jumps found. (Code = 47) Position 1 = 27, Position 2 = 32
Branch analysis from position: 27
2 jumps found. (Code = 47) Position 1 = 33, Position 2 = 38
Branch analysis from position: 33
2 jumps found. (Code = 47) Position 1 = 39, Position 2 = 44
Branch analysis from position: 39
2 jumps found. (Code = 47) Position 1 = 45, Position 2 = 50
Branch analysis from position: 45
2 jumps found. (Code = 47) Position 1 = 51, Position 2 = 56
Branch analysis from position: 51
2 jumps found. (Code = 47) Position 1 = 57, Position 2 = 62
Branch analysis from position: 57
2 jumps found. (Code = 47) Position 1 = 63, Position 2 = 68
Branch analysis from position: 63
2 jumps found. (Code = 43) Position 1 = 69, Position 2 = 71
Branch analysis from position: 69
1 jumps found. (Code = 42) Position 1 = 72
Branch analysis from position: 72
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 71
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 68
Branch analysis from position: 62
Branch analysis from position: 56
Branch analysis from position: 50
Branch analysis from position: 44
Branch analysis from position: 38
Branch analysis from position: 32
Branch analysis from position: 19
2 jumps found. (Code = 47) Position 1 = 27, Position 2 = 32
Branch analysis from position: 27
Branch analysis from position: 32
Branch analysis from position: 74
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 74
filename:       /in/rNL8R
function name:  (null)
number of ops:  76
compiled vars:  !0 = $array, !1 = $color, !2 = $out
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    9     1      > FE_RESET_R                                       $4      !0, ->74
          2    > > FE_FETCH_R                                               $4, !1, ->74
   10     3    >   NOP                                                      
          4        FAST_CONCAT                                      ~5      '%0A---%0A', !1
          5        ECHO                                                     ~5
   11     6        ECHO                                                     '%0A%09'
          7        INIT_FCALL                                               'preg_match'
          8        SEND_VAL                                                 '%7E%5Cb%5B1-8%5D%5Cb%7E'
          9        SEND_VAR                                                 !1
         10        SEND_REF                                                 !2
         11        DO_ICALL                                         $6      
         12      > JMPZ                                                     $6, ->19
         13    >   ROPE_INIT                                     3  ~9      'checked+%28satisfied+by+'
         14        FETCH_DIM_R                                      ~7      !2, 0
         15        ROPE_ADD                                      1  ~9      ~9, ~7
         16        ROPE_END                                      2  ~8      ~9, '%29'
         17        QM_ASSIGN                                        ~11     ~8
         18      > JMP                                                      ->20
         19    >   QM_ASSIGN                                        ~11     'not+found'
         20    >   ECHO                                                     ~11
   12    21        ECHO                                                     '%0A%09Chad+says%3A+'
         22        INIT_FCALL                                               'strpos'
         23        SEND_VAR                                                 !1
         24        SEND_VAL                                                 '1'
         25        DO_ICALL                                         $12     
         26      > JMPNZ_EX                                         ~13     $12, ->32
         27    >   INIT_FCALL                                               'strpos'
         28        SEND_VAR                                                 !1
         29        SEND_VAL                                                 '2'
         30        DO_ICALL                                         $14     
         31        BOOL                                             ~13     $14
         32    > > JMPNZ_EX                                         ~13     ~13, ->38
         33    >   INIT_FCALL                                               'strpos'
         34        SEND_VAR                                                 !1
         35        SEND_VAL                                                 '3'
         36        DO_ICALL                                         $15     
         37        BOOL                                             ~13     $15
         38    > > JMPNZ_EX                                         ~13     ~13, ->44
         39    >   INIT_FCALL                                               'strpos'
         40        SEND_VAR                                                 !1
         41        SEND_VAL                                                 '4'
         42        DO_ICALL                                         $16     
         43        BOOL                                             ~13     $16
         44    > > JMPNZ_EX                                         ~13     ~13, ->50
         45    >   INIT_FCALL                                               'strpos'
         46        SEND_VAR                                                 !1
         47        SEND_VAL                                                 '5'
         48        DO_ICALL                                         $17     
         49        BOOL                                             ~13     $17
         50    > > JMPNZ_EX                                         ~13     ~13, ->56
         51    >   INIT_FCALL                                               'strpos'
         52        SEND_VAR                                                 !1
         53        SEND_VAL                                                 '6'
         54        DO_ICALL                                         $18     
         55        BOOL                                             ~13     $18
         56    > > JMPNZ_EX                                         ~13     ~13, ->62
         57    >   INIT_FCALL                                               'strpos'
         58        SEND_VAR                                                 !1
         59        SEND_VAL                                                 '7'
         60        DO_ICALL                                         $19     
         61        BOOL                                             ~13     $19
         62    > > JMPNZ_EX                                         ~13     ~13, ->68
         63    >   INIT_FCALL                                               'strpos'
         64        SEND_VAR                                                 !1
         65        SEND_VAL                                                 '8'
         66        DO_ICALL                                         $20     
         67        BOOL                                             ~13     $20
         68    > > JMPZ                                                     ~13, ->71
         69    >   QM_ASSIGN                                        ~21     'found'
         70      > JMP                                                      ->72
         71    >   QM_ASSIGN                                        ~21     'not+found'
         72    >   ECHO                                                     ~21
    9    73      > JMP                                                      ->2
         74    >   FE_FREE                                                  $4
   13    75      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.22 ms | 1409 KiB | 17 Q