3v4l.org

run code in 300+ PHP versions simultaneously
<?php $search = htmlentities("\*apple|\\*\\\phpinfo();|apple/e"); $regex = "/".$search."/"; echo $regex."\n"; if (strpos($search, 'apple') !== false){ echo preg_replace("/".$search, $search." <img src='".$search.".png'>", "apple"); }elseif (strpos($search, 'orange') !== false){ echo preg_replace("/".$search."/", $search." <img src='".$search.".png'>", "orange"); }elseif (strpos($search, 'banana') !== false){ echo preg_replace("/".$search."/", $search." <img src='".$search.".png'>", "banana"); }elseif (strpos($search, 'kiwi') !== false){ echo preg_replace("/".$search."/", $search." <img src='".$search.".png'>", "kiwi"); }else echo "Please search for apple, orange, banana, or kiwi."; ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 26
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 81
Branch analysis from position: 81
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
2 jumps found. (Code = 43) Position 1 = 32, Position 2 = 44
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 81
Branch analysis from position: 81
Branch analysis from position: 44
2 jumps found. (Code = 43) Position 1 = 50, Position 2 = 62
Branch analysis from position: 50
1 jumps found. (Code = 42) Position 1 = 81
Branch analysis from position: 81
Branch analysis from position: 62
2 jumps found. (Code = 43) Position 1 = 68, Position 2 = 80
Branch analysis from position: 68
1 jumps found. (Code = 42) Position 1 = 81
Branch analysis from position: 81
Branch analysis from position: 80
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Tk8SK
function name:  (null)
number of ops:  82
compiled vars:  !0 = $search, !1 = $regex
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'htmlentities'
          1        SEND_VAL                                                 '%5C%2Aapple%7C%5C%2A%5C%5Cphpinfo%28%29%3B%7Capple%2Fe'
          2        DO_ICALL                                         $2      
          3        ASSIGN                                                   !0, $2
    3     4        CONCAT                                           ~4      '%2F', !0
          5        CONCAT                                           ~5      ~4, '%2F'
          6        ASSIGN                                                   !1, ~5
    4     7        CONCAT                                           ~7      !1, '%0A'
          8        ECHO                                                     ~7
    5     9        INIT_FCALL                                               'strpos'
         10        SEND_VAR                                                 !0
         11        SEND_VAL                                                 'apple'
         12        DO_ICALL                                         $8      
         13        TYPE_CHECK                                  1018          $8
         14      > JMPZ                                                     ~9, ->26
    6    15    >   INIT_FCALL                                               'preg_replace'
         16        CONCAT                                           ~10     '%2F', !0
         17        SEND_VAL                                                 ~10
         18        CONCAT                                           ~11     !0, '+%3Cimg+src%3D%27'
         19        CONCAT                                           ~12     ~11, !0
         20        CONCAT                                           ~13     ~12, '.png%27%3E'
         21        SEND_VAL                                                 ~13
         22        SEND_VAL                                                 'apple'
         23        DO_ICALL                                         $14     
         24        ECHO                                                     $14
         25      > JMP                                                      ->81
    7    26    >   INIT_FCALL                                               'strpos'
         27        SEND_VAR                                                 !0
         28        SEND_VAL                                                 'orange'
         29        DO_ICALL                                         $15     
         30        TYPE_CHECK                                  1018          $15
         31      > JMPZ                                                     ~16, ->44
    8    32    >   INIT_FCALL                                               'preg_replace'
         33        CONCAT                                           ~17     '%2F', !0
         34        CONCAT                                           ~18     ~17, '%2F'
         35        SEND_VAL                                                 ~18
         36        CONCAT                                           ~19     !0, '+%3Cimg+src%3D%27'
         37        CONCAT                                           ~20     ~19, !0
         38        CONCAT                                           ~21     ~20, '.png%27%3E'
         39        SEND_VAL                                                 ~21
         40        SEND_VAL                                                 'orange'
         41        DO_ICALL                                         $22     
         42        ECHO                                                     $22
         43      > JMP                                                      ->81
    9    44    >   INIT_FCALL                                               'strpos'
         45        SEND_VAR                                                 !0
         46        SEND_VAL                                                 'banana'
         47        DO_ICALL                                         $23     
         48        TYPE_CHECK                                  1018          $23
         49      > JMPZ                                                     ~24, ->62
   10    50    >   INIT_FCALL                                               'preg_replace'
         51        CONCAT                                           ~25     '%2F', !0
         52        CONCAT                                           ~26     ~25, '%2F'
         53        SEND_VAL                                                 ~26
         54        CONCAT                                           ~27     !0, '+%3Cimg+src%3D%27'
         55        CONCAT                                           ~28     ~27, !0
         56        CONCAT                                           ~29     ~28, '.png%27%3E'
         57        SEND_VAL                                                 ~29
         58        SEND_VAL                                                 'banana'
         59        DO_ICALL                                         $30     
         60        ECHO                                                     $30
         61      > JMP                                                      ->81
   11    62    >   INIT_FCALL                                               'strpos'
         63        SEND_VAR                                                 !0
         64        SEND_VAL                                                 'kiwi'
         65        DO_ICALL                                         $31     
         66        TYPE_CHECK                                  1018          $31
         67      > JMPZ                                                     ~32, ->80
   12    68    >   INIT_FCALL                                               'preg_replace'
         69        CONCAT                                           ~33     '%2F', !0
         70        CONCAT                                           ~34     ~33, '%2F'
         71        SEND_VAL                                                 ~34
         72        CONCAT                                           ~35     !0, '+%3Cimg+src%3D%27'
         73        CONCAT                                           ~36     ~35, !0
         74        CONCAT                                           ~37     ~36, '.png%27%3E'
         75        SEND_VAL                                                 ~37
         76        SEND_VAL                                                 'kiwi'
         77        DO_ICALL                                         $38     
         78        ECHO                                                     $38
         79      > JMP                                                      ->81
   13    80    >   ECHO                                                     'Please+search+for+apple%2C+orange%2C+banana%2C+or+kiwi.'
   14    81    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.88 ms | 1396 KiB | 19 Q