3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.95 ms | 1396 KiB | 19 Q