3v4l.org

run code in 500+ PHP versions simultaneously
<?php $count= 1024; $in= ""; $script= $out= "function something (a,b,c) { do(this); do(that); alert('guruguru'); } "; while (strlen($out)!=0 && strlen($out)!=strlen($in)) { echo "count: ".$count."\n"; $in= "<html>\n<head>\n<script type=whatever>".str_repeat($script, $count)."</script>\n</head>\n</html>"; printf("%7d bytes original.\n", strlen($in)); $out= preg_replace('!<script\b[^>]*>.*</script>!sU', '', $in); printf("%7d bytes after script-removal.\n\n", strlen($out)); $count*= 2; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
2 jumps found. (Code = 46) Position 1 = 32, Position 2 = 36
Branch analysis from position: 32
2 jumps found. (Code = 44) Position 1 = 37, Position 2 = 5
Branch analysis from position: 37
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 46) Position 1 = 32, Position 2 = 36
Branch analysis from position: 32
Branch analysis from position: 36
Branch analysis from position: 36
filename:       /in/fjL9Q
function name:  (null)
number of ops:  38
compiled vars:  !0 = $count, !1 = $in, !2 = $script, !3 = $out
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, 1024
    5     1        ASSIGN                                                       !1, ''
    6     2        ASSIGN                                               ~6      !3, 'function+something+%28a%2Cb%2Cc%29+%7B+do%28this%29%3B+do%28that%29%3B+alert%28%27guruguru%27%29%3B+%7D+'
          3        ASSIGN                                                       !2, ~6
    8     4      > JMP                                                          ->29
    9     5    >   CONCAT                                               ~8      'count%3A+', !0
          6        CONCAT                                               ~9      ~8, '%0A'
          7        ECHO                                                         ~9
   10     8        INIT_FCALL                                                   'str_repeat'
          9        SEND_VAR                                                     !2
         10        SEND_VAR                                                     !0
         11        DO_ICALL                                             $10     
         12        CONCAT                                               ~11     '%3Chtml%3E%0A%3Chead%3E%0A%3Cscript+type%3Dwhatever%3E', $10
         13        CONCAT                                               ~12     ~11, '%3C%2Fscript%3E%0A%3C%2Fhead%3E%0A%3C%2Fhtml%3E'
         14        ASSIGN                                                       !1, ~12
   11    15        INIT_FCALL                                                   'printf'
         16        SEND_VAL                                                     '%257d+bytes+original.%0A'
         17        STRLEN                                               ~14     !1
         18        SEND_VAL                                                     ~14
         19        DO_ICALL                                                     
   12    20        FRAMELESS_ICALL_3                preg_replace        ~16     '%21%3Cscript%5Cb%5B%5E%3E%5D%2A%3E.%2A%3C%2Fscript%3E%21sU', ''
         21        OP_DATA                                                      !1
         22        ASSIGN                                                       !3, ~16
   13    23        INIT_FCALL                                                   'printf'
         24        SEND_VAL                                                     '%257d+bytes+after+script-removal.%0A%0A'
         25        STRLEN                                               ~18     !3
         26        SEND_VAL                                                     ~18
         27        DO_ICALL                                                     
   14    28        ASSIGN_OP                                         3          !0, 2
    8    29    >   STRLEN                                               ~21     !3
         30        IS_NOT_EQUAL                                         ~22     ~21, 0
         31      > JMPZ_EX                                              ~22     ~22, ->36
         32    >   STRLEN                                               ~23     !3
         33        STRLEN                                               ~24     !1
         34        IS_NOT_EQUAL                                         ~25     ~23, ~24
         35        BOOL                                                 ~22     ~25
         36    > > JMPNZ                                                        ~22, ->5
   15    37    > > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
171.83 ms | 3398 KiB | 15 Q