3v4l.org

run code in 300+ PHP versions simultaneously
<?php $BRANCHING_PROFILE = "09. Reading Comprehension - Post Test"; if (preg_match('/(Reading Comprehension)/', $BRANCHING_PROFILE ) === 1) { $code='AC2'; } else if (preg_match('/(Sentence Skills)/', $BRANCHING_PROFILE) === 1) { $code='AC1'; } else if (preg_match('/(Arithmetic)/', $BRANCHING_PROFILE) === 1) { $code='AC5'; } else if (preg_match('/(Elementary Algebra/', $BRANCHING_PROFILE) === 1) { $code='AC6'; } else if (preg_match('/College Level Math/i', $BRANCHING_PROFILE) === 1) { $code='AC7'; } else if (preg_match('(Reading Comprehension - Post Test)', $BRANCHING_PROFILE) === 1) { $code='PA2'; } else if (preg_match('/Sentence Skills - Post Test/i', $BRANCHING_PROFILE) === 1) { $code='PA1'; } else if (preg_match('/Arithmetic - Post Test/i', $BRANCHING_PROFILE) === 1) { $code='PA5'; } else if (preg_match('/Elementary Algebra - Post Test/i', $BRANCHING_PROFILE) === 1) { $code='PA6'; } else if (preg_match('/College Level Math - Post Test/i', $BRANCHING_PROFILE) === 1) { $code='PA7'; } var_dump(preg_match('(Reading Comprehension - Post Test)', $BRANCHING_PROFILE)); echo "Branching Profile: " . $BRANCHING_PROFILE . "\n\r"; echo "Code: " . $code;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 9
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 80
Branch analysis from position: 80
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 17
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 80
Branch analysis from position: 80
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 25
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 80
Branch analysis from position: 80
Branch analysis from position: 25
2 jumps found. (Code = 43) Position 1 = 31, Position 2 = 33
Branch analysis from position: 31
1 jumps found. (Code = 42) Position 1 = 80
Branch analysis from position: 80
Branch analysis from position: 33
2 jumps found. (Code = 43) Position 1 = 39, Position 2 = 41
Branch analysis from position: 39
1 jumps found. (Code = 42) Position 1 = 80
Branch analysis from position: 80
Branch analysis from position: 41
2 jumps found. (Code = 43) Position 1 = 47, Position 2 = 49
Branch analysis from position: 47
1 jumps found. (Code = 42) Position 1 = 80
Branch analysis from position: 80
Branch analysis from position: 49
2 jumps found. (Code = 43) Position 1 = 55, Position 2 = 57
Branch analysis from position: 55
1 jumps found. (Code = 42) Position 1 = 80
Branch analysis from position: 80
Branch analysis from position: 57
2 jumps found. (Code = 43) Position 1 = 63, Position 2 = 65
Branch analysis from position: 63
1 jumps found. (Code = 42) Position 1 = 80
Branch analysis from position: 80
Branch analysis from position: 65
2 jumps found. (Code = 43) Position 1 = 71, Position 2 = 73
Branch analysis from position: 71
1 jumps found. (Code = 42) Position 1 = 80
Branch analysis from position: 80
Branch analysis from position: 73
2 jumps found. (Code = 43) Position 1 = 79, Position 2 = 80
Branch analysis from position: 79
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 80
filename:       /in/WhePX
function name:  (null)
number of ops:  93
compiled vars:  !0 = $BRANCHING_PROFILE, !1 = $code
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '09.+Reading+Comprehension+-+Post+Test'
    3     1        INIT_FCALL                                               'preg_match'
          2        SEND_VAL                                                 '%2F%28Reading+Comprehension%29%2F'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $3      
          5        IS_IDENTICAL                                             $3, 1
          6      > JMPZ                                                     ~4, ->9
    5     7    >   ASSIGN                                                   !1, 'AC2'
    3     8      > JMP                                                      ->80
    7     9    >   INIT_FCALL                                               'preg_match'
         10        SEND_VAL                                                 '%2F%28Sentence+Skills%29%2F'
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                         $6      
         13        IS_IDENTICAL                                             $6, 1
         14      > JMPZ                                                     ~7, ->17
    9    15    >   ASSIGN                                                   !1, 'AC1'
    7    16      > JMP                                                      ->80
   11    17    >   INIT_FCALL                                               'preg_match'
         18        SEND_VAL                                                 '%2F%28Arithmetic%29%2F'
         19        SEND_VAR                                                 !0
         20        DO_ICALL                                         $9      
         21        IS_IDENTICAL                                             $9, 1
         22      > JMPZ                                                     ~10, ->25
   13    23    >   ASSIGN                                                   !1, 'AC5'
   11    24      > JMP                                                      ->80
   15    25    >   INIT_FCALL                                               'preg_match'
         26        SEND_VAL                                                 '%2F%28Elementary+Algebra%2F'
         27        SEND_VAR                                                 !0
         28        DO_ICALL                                         $12     
         29        IS_IDENTICAL                                             $12, 1
         30      > JMPZ                                                     ~13, ->33
   17    31    >   ASSIGN                                                   !1, 'AC6'
   15    32      > JMP                                                      ->80
   19    33    >   INIT_FCALL                                               'preg_match'
         34        SEND_VAL                                                 '%2FCollege+Level+Math%2Fi'
         35        SEND_VAR                                                 !0
         36        DO_ICALL                                         $15     
         37        IS_IDENTICAL                                             $15, 1
         38      > JMPZ                                                     ~16, ->41
   21    39    >   ASSIGN                                                   !1, 'AC7'
   19    40      > JMP                                                      ->80
   23    41    >   INIT_FCALL                                               'preg_match'
         42        SEND_VAL                                                 '%28Reading+Comprehension+-+Post+Test%29'
         43        SEND_VAR                                                 !0
         44        DO_ICALL                                         $18     
         45        IS_IDENTICAL                                             $18, 1
         46      > JMPZ                                                     ~19, ->49
   25    47    >   ASSIGN                                                   !1, 'PA2'
   23    48      > JMP                                                      ->80
   27    49    >   INIT_FCALL                                               'preg_match'
         50        SEND_VAL                                                 '%2FSentence+Skills+-+Post+Test%2Fi'
         51        SEND_VAR                                                 !0
         52        DO_ICALL                                         $21     
         53        IS_IDENTICAL                                             $21, 1
         54      > JMPZ                                                     ~22, ->57
   29    55    >   ASSIGN                                                   !1, 'PA1'
   27    56      > JMP                                                      ->80
   31    57    >   INIT_FCALL                                               'preg_match'
         58        SEND_VAL                                                 '%2FArithmetic+-+Post+Test%2Fi'
         59        SEND_VAR                                                 !0
         60        DO_ICALL                                         $24     
         61        IS_IDENTICAL                                             $24, 1
         62      > JMPZ                                                     ~25, ->65
   33    63    >   ASSIGN                                                   !1, 'PA5'
   31    64      > JMP                                                      ->80
   35    65    >   INIT_FCALL                                               'preg_match'
         66        SEND_VAL                                                 '%2FElementary+Algebra+-+Post+Test%2Fi'
         67        SEND_VAR                                                 !0
         68        DO_ICALL                                         $27     
         69        IS_IDENTICAL                                             $27, 1
         70      > JMPZ                                                     ~28, ->73
   37    71    >   ASSIGN                                                   !1, 'PA6'
   35    72      > JMP                                                      ->80
   39    73    >   INIT_FCALL                                               'preg_match'
         74        SEND_VAL                                                 '%2FCollege+Level+Math+-+Post+Test%2Fi'
         75        SEND_VAR                                                 !0
         76        DO_ICALL                                         $30     
         77        IS_IDENTICAL                                             $30, 1
         78      > JMPZ                                                     ~31, ->80
   41    79    >   ASSIGN                                                   !1, 'PA7'
   44    80    >   INIT_FCALL                                               'var_dump'
         81        INIT_FCALL                                               'preg_match'
         82        SEND_VAL                                                 '%28Reading+Comprehension+-+Post+Test%29'
         83        SEND_VAR                                                 !0
         84        DO_ICALL                                         $33     
         85        SEND_VAR                                                 $33
         86        DO_ICALL                                                 
   45    87        CONCAT                                           ~35     'Branching+Profile%3A+', !0
         88        CONCAT                                           ~36     ~35, '%0A%0D'
         89        ECHO                                                     ~36
   46    90        CONCAT                                           ~37     'Code%3A+', !1
         91        ECHO                                                     ~37
         92      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.81 ms | 1010 KiB | 15 Q