3v4l.org

run code in 300+ PHP versions simultaneously
<?php //$search = htmlentities($_GET['search']); $search=htmlentities("phpinfo()|apple\x00"); echo $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 "Don't work.";?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 23
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Td82O
function name:  (null)
number of ops:  25
compiled vars:  !0 = $search
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'htmlentities'
          1        SEND_VAL                                                 'phpinfo%28%29%7Capple%00'
          2        DO_ICALL                                         $1      
          3        ASSIGN                                                   !0, $1
    4     4        ECHO                                                     !0
    5     5        INIT_FCALL                                               'strpos'
          6        SEND_VAR                                                 !0
          7        SEND_VAL                                                 'apple'
          8        DO_ICALL                                         $3      
          9        TYPE_CHECK                                  1018          $3
         10      > JMPZ                                                     ~4, ->23
    6    11    >   INIT_FCALL                                               'preg_replace'
         12        CONCAT                                           ~5      '%2F', !0
         13        CONCAT                                           ~6      ~5, '%2F'
         14        SEND_VAL                                                 ~6
         15        CONCAT                                           ~7      !0, '+%3Cimg+src%3D%27'
         16        CONCAT                                           ~8      ~7, !0
         17        CONCAT                                           ~9      ~8, '.png%27%3E'
         18        SEND_VAL                                                 ~9
         19        SEND_VAL                                                 'apple'
         20        DO_ICALL                                         $10     
         21        ECHO                                                     $10
         22      > JMP                                                      ->24
   14    23    >   ECHO                                                     'Don%27t+work.'
         24    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.09 ms | 1395 KiB | 19 Q