3v4l.org

run code in 300+ PHP versions simultaneously
<?php $srch = substr("echo 'apple1'\e", 0, -1); echo $srch;echo "\n"; $search = htmlentities($srch); echo $search; echo "\n"; if (strpos($search, 'apple') !== false){ echo "in the if!\n"; echo preg_replace("/".$search."/", $search." <img src='".$search.".png'>", "apple"); }; ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 32
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 32
filename:       /in/08JVI
function name:  (null)
number of ops:  33
compiled vars:  !0 = $srch, !1 = $search
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'substr'
          1        SEND_VAL                                                 'echo+%27apple1%27%1B'
          2        SEND_VAL                                                 0
          3        SEND_VAL                                                 -1
          4        DO_ICALL                                         $2      
          5        ASSIGN                                                   !0, $2
    3     6        ECHO                                                     !0
          7        ECHO                                                     '%0A'
    4     8        INIT_FCALL                                               'htmlentities'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $4      
         11        ASSIGN                                                   !1, $4
    5    12        ECHO                                                     !1
         13        ECHO                                                     '%0A'
    6    14        INIT_FCALL                                               'strpos'
         15        SEND_VAR                                                 !1
         16        SEND_VAL                                                 'apple'
         17        DO_ICALL                                         $6      
         18        TYPE_CHECK                                  1018          $6
         19      > JMPZ                                                     ~7, ->32
    7    20    >   ECHO                                                     'in+the+if%21%0A'
    8    21        INIT_FCALL                                               'preg_replace'
         22        CONCAT                                           ~8      '%2F', !1
         23        CONCAT                                           ~9      ~8, '%2F'
         24        SEND_VAL                                                 ~9
         25        CONCAT                                           ~10     !1, '+%3Cimg+src%3D%27'
         26        CONCAT                                           ~11     ~10, !1
         27        CONCAT                                           ~12     ~11, '.png%27%3E'
         28        SEND_VAL                                                 ~12
         29        SEND_VAL                                                 'apple'
         30        DO_ICALL                                         $13     
         31        ECHO                                                     $13
   10    32    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.28 ms | 1396 KiB | 21 Q