3v4l.org

run code in 300+ PHP versions simultaneously
<?php if (isset($_GET['search'])){ $search = htmlentities($_GET['search']); 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 = 3, Position 2 = 82
Branch analysis from position: 3
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
Branch analysis from position: 82
filename:       /in/0ktj2
function name:  (null)
number of ops:  83
compiled vars:  !0 = $search
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   FETCH_IS                                         ~1      '_GET'
          1        ISSET_ISEMPTY_DIM_OBJ                         0          ~1, 'search'
          2      > JMPZ                                                     ~2, ->82
    3     3    >   INIT_FCALL                                               'htmlentities'
          4        FETCH_R                      global              ~3      '_GET'
          5        FETCH_DIM_R                                      ~4      ~3, 'search'
          6        SEND_VAL                                                 ~4
          7        DO_ICALL                                         $5      
          8        ASSIGN                                                   !0, $5
    4     9        INIT_FCALL                                               'strpos'
         10        SEND_VAR                                                 !0
         11        SEND_VAL                                                 'apple'
         12        DO_ICALL                                         $7      
         13        TYPE_CHECK                                  1018          $7
         14      > JMPZ                                                     ~8, ->27
    5    15    >   INIT_FCALL                                               'preg_replace'
         16        CONCAT                                           ~9      '%2F', !0
         17        CONCAT                                           ~10     ~9, '%2F'
         18        SEND_VAL                                                 ~10
         19        CONCAT                                           ~11     !0, '+%3Cimg+src%3D%27'
         20        CONCAT                                           ~12     ~11, !0
         21        CONCAT                                           ~13     ~12, '.png%27%3E'
         22        SEND_VAL                                                 ~13
         23        SEND_VAL                                                 'apple'
         24        DO_ICALL                                         $14     
         25        ECHO                                                     $14
         26      > JMP                                                      ->82
    6    27    >   INIT_FCALL                                               'strpos'
         28        SEND_VAR                                                 !0
         29        SEND_VAL                                                 'orange'
         30        DO_ICALL                                         $15     
         31        TYPE_CHECK                                  1018          $15
         32      > JMPZ                                                     ~16, ->45
    7    33    >   INIT_FCALL                                               'preg_replace'
         34        CONCAT                                           ~17     '%2F', !0
         35        CONCAT                                           ~18     ~17, '%2F'
         36        SEND_VAL                                                 ~18
         37        CONCAT                                           ~19     !0, '+%3Cimg+src%3D%27'
         38        CONCAT                                           ~20     ~19, !0
         39        CONCAT                                           ~21     ~20, '.png%27%3E'
         40        SEND_VAL                                                 ~21
         41        SEND_VAL                                                 'orange'
         42        DO_ICALL                                         $22     
         43        ECHO                                                     $22
         44      > JMP                                                      ->82
    8    45    >   INIT_FCALL                                               'strpos'
         46        SEND_VAR                                                 !0
         47        SEND_VAL                                                 'banana'
         48        DO_ICALL                                         $23     
         49        TYPE_CHECK                                  1018          $23
         50      > JMPZ                                                     ~24, ->63
    9    51    >   INIT_FCALL                                               'preg_replace'
         52        CONCAT                                           ~25     '%2F', !0
         53        CONCAT                                           ~26     ~25, '%2F'
         54        SEND_VAL                                                 ~26
         55        CONCAT                                           ~27     !0, '+%3Cimg+src%3D%27'
         56        CONCAT                                           ~28     ~27, !0
         57        CONCAT                                           ~29     ~28, '.png%27%3E'
         58        SEND_VAL                                                 ~29
         59        SEND_VAL                                                 'banana'
         60        DO_ICALL                                         $30     
         61        ECHO                                                     $30
         62      > JMP                                                      ->82
   10    63    >   INIT_FCALL                                               'strpos'
         64        SEND_VAR                                                 !0
         65        SEND_VAL                                                 'kiwi'
         66        DO_ICALL                                         $31     
         67        TYPE_CHECK                                  1018          $31
         68      > JMPZ                                                     ~32, ->81
   11    69    >   INIT_FCALL                                               'preg_replace'
         70        CONCAT                                           ~33     '%2F', !0
         71        CONCAT                                           ~34     ~33, '%2F'
         72        SEND_VAL                                                 ~34
         73        CONCAT                                           ~35     !0, '+%3Cimg+src%3D%27'
         74        CONCAT                                           ~36     ~35, !0
         75        CONCAT                                           ~37     ~36, '.png%27%3E'
         76        SEND_VAL                                                 ~37
         77        SEND_VAL                                                 'kiwi'
         78        DO_ICALL                                         $38     
         79        ECHO                                                     $38
         80      > JMP                                                      ->82
   12    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:
153.96 ms | 1404 KiB | 19 Q