3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $search = htmlentities("(apple|phpinfo())/e\0"); if (strpos($search, 'apple') !== false){ echo preg_replace("/".$search."/", $search, "apple"); }else echo "Please search for apple, orange, banana, or kiwi.";
based on 6BTcZ
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 = 20
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/M0de4
function name:  (null)
number of ops:  21
compiled vars:  !0 = $search
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   2     0  E >   INIT_FCALL                                               'htmlentities'
         1        SEND_VAL                                                 '%28apple%7Cphpinfo%28%29%29%2Fe%00'
         2        DO_ICALL                                         $1      
         3        ASSIGN                                                   !0, $1
   3     4        INIT_FCALL                                               'strpos'
         5        SEND_VAR                                                 !0
         6        SEND_VAL                                                 'apple'
         7        DO_ICALL                                         $3      
         8        IS_NOT_IDENTICAL                                 ~4      $3, <false>
         9      > JMPZ                                                     ~4, ->19
   4    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                                                      ->20
   5    19    >   ECHO                                                     'Please+search+for+apple%2C+orange%2C+banana%2C+or+kiwi.'
        20    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 7.3.0