3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = "<html><body> vdfbsdbg \n </body> \n </html>"; $pos = strpos($html, '</body>'); if ($pos !== false) { $str = substr($html, 0, $pos); $final = $str . '==IMG==' . substr($html, $pos); print_r($final); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 24
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
filename:       /in/1UJXl
function name:  (null)
number of ops:  25
compiled vars:  !0 = $html, !1 = $pos, !2 = $str, !3 = $final
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3Chtml%3E%3Cbody%3E+vdfbsdbg+%0A+%3C%2Fbody%3E+%0A+%3C%2Fhtml%3E'
    4     1        INIT_FCALL                                               'strpos'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 '%3C%2Fbody%3E'
          4        DO_ICALL                                         $5      
          5        ASSIGN                                                   !1, $5
    6     6        TYPE_CHECK                                  1018          !1
          7      > JMPZ                                                     ~7, ->24
    7     8    >   INIT_FCALL                                               'substr'
          9        SEND_VAR                                                 !0
         10        SEND_VAL                                                 0
         11        SEND_VAR                                                 !1
         12        DO_ICALL                                         $8      
         13        ASSIGN                                                   !2, $8
    8    14        CONCAT                                           ~10     !2, '%3D%3DIMG%3D%3D'
         15        INIT_FCALL                                               'substr'
         16        SEND_VAR                                                 !0
         17        SEND_VAR                                                 !1
         18        DO_ICALL                                         $11     
         19        CONCAT                                           ~12     ~10, $11
         20        ASSIGN                                                   !3, ~12
   10    21        INIT_FCALL                                               'print_r'
         22        SEND_VAR                                                 !3
         23        DO_ICALL                                                 
   11    24    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.92 ms | 1387 KiB | 19 Q