3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.24 ms | 1392 KiB | 19 Q