3v4l.org

run code in 300+ PHP versions simultaneously
<?php $code = '**3'; $test_code = str_replace('*', '[0-9]{1}', $code); echo 'test_code = '.$test_code."\n"; $course_filters = array('220','123'); if (!empty($course_filters)) { foreach ($course_filters as $key => $code) { preg_match('/'.$test_code.'/', $code, $matches); if ($matches) { echo "found = ".$code; } } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 29
Branch analysis from position: 14
2 jumps found. (Code = 77) Position 1 = 15, Position 2 = 28
Branch analysis from position: 15
2 jumps found. (Code = 78) Position 1 = 16, Position 2 = 28
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 25, Position 2 = 27
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
Branch analysis from position: 27
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
Branch analysis from position: 29
filename:       /in/9fZDC
function name:  (null)
number of ops:  30
compiled vars:  !0 = $code, !1 = $test_code, !2 = $course_filters, !3 = $key, !4 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%2A%2A3'
    4     1        INIT_FCALL                                               'str_replace'
          2        SEND_VAL                                                 '%2A'
          3        SEND_VAL                                                 '%5B0-9%5D%7B1%7D'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $6      
          6        ASSIGN                                                   !1, $6
    5     7        CONCAT                                           ~8      'test_code+%3D+', !1
          8        CONCAT                                           ~9      ~8, '%0A'
          9        ECHO                                                     ~9
    7    10        ASSIGN                                                   !2, <array>
    9    11        ISSET_ISEMPTY_CV                                 ~11     !2
         12        BOOL_NOT                                         ~12     ~11
         13      > JMPZ                                                     ~12, ->29
   10    14    > > FE_RESET_R                                       $13     !2, ->28
         15    > > FE_FETCH_R                                       ~14     $13, !0, ->28
         16    >   ASSIGN                                                   !3, ~14
   11    17        INIT_FCALL                                               'preg_match'
         18        CONCAT                                           ~16     '%2F', !1
         19        CONCAT                                           ~17     ~16, '%2F'
         20        SEND_VAL                                                 ~17
         21        SEND_VAR                                                 !0
         22        SEND_REF                                                 !4
         23        DO_ICALL                                                 
   12    24      > JMPZ                                                     !4, ->27
   13    25    >   CONCAT                                           ~19     'found+%3D+', !0
         26        ECHO                                                     ~19
   10    27    > > JMP                                                      ->15
         28    >   FE_FREE                                                  $13
   16    29    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.6 ms | 1396 KiB | 17 Q