3v4l.org

run code in 300+ PHP versions simultaneously
<?php $fieldname = "<script language='JavaScript' type='text/javascript'> <!-- var prefix = 'mailto:'; var suffix = ''; var attribs = ''; var path = 'hr' 'ef' '='; var addy22804 = 'justinleegould' '@'; addy22804 = addy22804 'gmail' '.' 'com'; document.write( '<a ' path '\'' prefix addy22804 suffix '\'' attribs '>' ); document.write( addy22804 ); document.write( '<\/a>' ); //--> </script><script language='JavaScript' type='text/javascript'> <!-- document.write( '<span style=\'display: none;\'>' ); //--> </script>This e-mail address is being protected from spambots. You need JavaScript enabled to view it <script language='JavaScript' type='text/javascript'> <!-- document.write( '</' ); document.write( 'span>' ); //--> </script>"; $start = strpos($fieldname, "var path = 'hr'"); $end = strpos($fieldname, "document.write"); $fieldname = substr($fieldname, $start, $end - $start); $fieldname = substr($fieldname, strpos($fieldname, "var", 1)); echo $fieldname; /* strrpos — Find the position of the last occurrence of a substring in a string int strrpos ( string $haystack , string $needle [, int $offset = 0 ] ) Find the numeric position of the last occurrence of needle in the haystack string. strpos — Find the position of the first occurrence of a substring in a string mixed strpos ( string $haystack , mixed $needle [, int $offset = 0 ] ) string substr ( string $string , int $start [, int $length ] ) Returns the portion of string specified by the start and length parameters. */ ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4Q2Ru
function name:  (null)
number of ops:  30
compiled vars:  !0 = $fieldname, !1 = $start, !2 = $end
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3Cscript+language%3D%27JavaScript%27+type%3D%27text%2Fjavascript%27%3E+%3C%21--+var+prefix+%3D+%27mailto%3A%27%3B+var+suffix+%3D+%27%27%3B+var+attribs+%3D+%27%27%3B+var+path+%3D+%27hr%27+++%27ef%27+++%27%3D%27%3B+var+addy22804+%3D+%27justinleegould%27+++%27%40%27%3B+addy22804+%3D+addy22804+++%27gmail%27+++%27.%27+++%27com%27%3B+document.write%28+%27%3Ca+%27+++path+++%27%5C%27%27+++prefix+++addy22804+++suffix+++%27%5C%27%27+++attribs+++%27%3E%27+%29%3B+document.write%28+addy22804+%29%3B+document.write%28+%27%3C%5C%2Fa%3E%27+%29%3B+%2F%2F--%3E+%3C%2Fscript%3E%3Cscript+language%3D%27JavaScript%27+type%3D%27text%2Fjavascript%27%3E+%3C%21--+document.write%28+%27%3Cspan+style%3D%5C%27display%3A+none%3B%5C%27%3E%27+%29%3B+%2F%2F--%3E+%3C%2Fscript%3EThis+e-mail+address+is+being+protected+from+spambots.+You+need+JavaScript+enabled+to+view+it+%3Cscript+language%3D%27JavaScript%27+type%3D%27text%2Fjavascript%27%3E+%3C%21--+document.write%28+%27%3C%2F%27+%29%3B+document.write%28+%27span%3E%27+%29%3B+%2F%2F--%3E+%3C%2Fscript%3E'
    5     1        INIT_FCALL                                               'strpos'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 'var+path+%3D+%27hr%27'
          4        DO_ICALL                                         $4      
          5        ASSIGN                                                   !1, $4
    6     6        INIT_FCALL                                               'strpos'
          7        SEND_VAR                                                 !0
          8        SEND_VAL                                                 'document.write'
          9        DO_ICALL                                         $6      
         10        ASSIGN                                                   !2, $6
    7    11        INIT_FCALL                                               'substr'
         12        SEND_VAR                                                 !0
         13        SEND_VAR                                                 !1
         14        SUB                                              ~8      !2, !1
         15        SEND_VAL                                                 ~8
         16        DO_ICALL                                         $9      
         17        ASSIGN                                                   !0, $9
    8    18        INIT_FCALL                                               'substr'
         19        SEND_VAR                                                 !0
         20        INIT_FCALL                                               'strpos'
         21        SEND_VAR                                                 !0
         22        SEND_VAL                                                 'var'
         23        SEND_VAL                                                 1
         24        DO_ICALL                                         $11     
         25        SEND_VAR                                                 $11
         26        DO_ICALL                                         $12     
         27        ASSIGN                                                   !0, $12
    9    28        ECHO                                                     !0
   23    29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.75 ms | 1396 KiB | 17 Q