3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.79 ms | 1470 KiB | 16 Q