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)); $key = substr($fieldname, 4, strpos($fieldname, "=") - 5); echo $fieldname; echo "x=" . $key; /* 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/fofth
function name:  (null)
number of ops:  43
compiled vars:  !0 = $fieldname, !1 = $start, !2 = $end, !3 = $key
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                                         $5      
          5        ASSIGN                                                   !1, $5
    6     6        INIT_FCALL                                               'strpos'
          7        SEND_VAR                                                 !0
          8        SEND_VAL                                                 'document.write'
          9        DO_ICALL                                         $7      
         10        ASSIGN                                                   !2, $7
    7    11        INIT_FCALL                                               'substr'
         12        SEND_VAR                                                 !0
         13        SEND_VAR                                                 !1
         14        SUB                                              ~9      !2, !1
         15        SEND_VAL                                                 ~9
         16        DO_ICALL                                         $10     
         17        ASSIGN                                                   !0, $10
    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                                         $12     
         25        SEND_VAR                                                 $12
         26        DO_ICALL                                         $13     
         27        ASSIGN                                                   !0, $13
    9    28        INIT_FCALL                                               'substr'
         29        SEND_VAR                                                 !0
         30        SEND_VAL                                                 4
         31        INIT_FCALL                                               'strpos'
         32        SEND_VAR                                                 !0
         33        SEND_VAL                                                 '%3D'
         34        DO_ICALL                                         $15     
         35        SUB                                              ~16     $15, 5
         36        SEND_VAL                                                 ~16
         37        DO_ICALL                                         $17     
         38        ASSIGN                                                   !3, $17
   10    39        ECHO                                                     !0
   11    40        CONCAT                                           ~19     'x%3D', !3
         41        ECHO                                                     ~19
   25    42      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.02 ms | 1392 KiB | 17 Q