3v4l.org

run code in 500+ PHP versions simultaneously
<?php function prepareForOutput($content, $exclude=[]) { if (stripos(PHP_OS, 'WIN') === 0) { if (in_array("\r", $exclude, true) === false) { $content = str_replace("\r", '\r', $content); } if (in_array("\n", $exclude, true) === false) { $content = str_replace("\n", '\n', $content); } if (in_array("\t", $exclude, true) === false) { $content = str_replace("\t", '\t', $content); } } else { if (in_array("\r", $exclude, true) === false) { $content = str_replace("\r", "\033[30;1m\\r\033[0m", $content); } if (in_array("\n", $exclude, true) === false) { $content = str_replace("\n", "\033[30;1m\\n\033[0m", $content); } if (in_array("\t", $exclude, true) === false) { $content = str_replace("\t", "\033[30;1m\\t\033[0m", $content); } if (in_array(' ', $exclude, true) === false) { $content = str_replace(' ', "\033[30;1m·\033[0m", $content); } }//end if return $content; } for ($i = 0; $i < 10000; $i++) { prepareForOutput('{echo 1;}', ["\r"]); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 9, Position 2 = 2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 2
2 jumps found. (Code = 44) Position 1 = 9, Position 2 = 2
Branch analysis from position: 9
Branch analysis from position: 2
filename:       /in/E3bVW
function name:  (null)
number of ops:  10
compiled vars:  !0 = $i
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   39     0  E >   ASSIGN                                                       !0, 0
          1      > JMP                                                          ->7
   40     2    >   INIT_FCALL                                                   'prepareforoutput'
          3        SEND_VAL                                                     '%7Becho+1%3B%7D'
          4        SEND_VAL                                                     <array>
          5        DO_FCALL                                          0          
   39     6        PRE_INC                                                      !0
          7    >   IS_SMALLER                                                   !0, 10000
          8      > JMPNZ                                                        ~4, ->2
   41     9    > > RETURN                                                       1

Function prepareforoutput:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 30
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 15
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 22
Branch analysis from position: 19
2 jumps found. (Code = 43) Position 1 = 26, Position 2 = 29
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 58
Branch analysis from position: 58
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
Branch analysis from position: 22
Branch analysis from position: 15
Branch analysis from position: 30
2 jumps found. (Code = 43) Position 1 = 34, Position 2 = 37
Branch analysis from position: 34
2 jumps found. (Code = 43) Position 1 = 41, Position 2 = 44
Branch analysis from position: 41
2 jumps found. (Code = 43) Position 1 = 48, Position 2 = 51
Branch analysis from position: 48
2 jumps found. (Code = 43) Position 1 = 55, Position 2 = 58
Branch analysis from position: 55
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 58
Branch analysis from position: 51
Branch analysis from position: 44
Branch analysis from position: 37
filename:       /in/E3bVW
function name:  prepareForOutput
number of ops:  60
compiled vars:  !0 = $content, !1 = $exclude
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   RECV                                                 !0      
          1        RECV_INIT                                            !1      <array>
    5     2        INIT_FCALL                                                   'stripos'
          3        SEND_VAL                                                     'Linux'
          4        SEND_VAL                                                     'WIN'
          5        DO_ICALL                                             $2      
          6        IS_IDENTICAL                                                 $2, 0
          7      > JMPZ                                                         ~3, ->30
    6     8    >   FRAMELESS_ICALL_3                in_array            ~4      '%0D', !1
          9        OP_DATA                                                      <true>
         10        TYPE_CHECK                                        4          ~4
         11      > JMPZ                                                         ~5, ->15
    7    12    >   FRAMELESS_ICALL_3                str_replace         ~6      '%0D', '%5Cr'
         13        OP_DATA                                                      !0
         14        ASSIGN                                                       !0, ~6
   10    15    >   FRAMELESS_ICALL_3                in_array            ~8      '%0A', !1
         16        OP_DATA                                                      <true>
         17        TYPE_CHECK                                        4          ~8
         18      > JMPZ                                                         ~9, ->22
   11    19    >   FRAMELESS_ICALL_3                str_replace         ~10     '%0A', '%5Cn'
         20        OP_DATA                                                      !0
         21        ASSIGN                                                       !0, ~10
   14    22    >   FRAMELESS_ICALL_3                in_array            ~12     '%09', !1
         23        OP_DATA                                                      <true>
         24        TYPE_CHECK                                        4          ~12
         25      > JMPZ                                                         ~13, ->29
   15    26    >   FRAMELESS_ICALL_3                str_replace         ~14     '%09', '%5Ct'
         27        OP_DATA                                                      !0
         28        ASSIGN                                                       !0, ~14
    5    29    > > JMP                                                          ->58
   18    30    >   FRAMELESS_ICALL_3                in_array            ~16     '%0D', !1
         31        OP_DATA                                                      <true>
         32        TYPE_CHECK                                        4          ~16
         33      > JMPZ                                                         ~17, ->37
   19    34    >   FRAMELESS_ICALL_3                str_replace         ~18     '%0D', '%1B%5B30%3B1m%5Cr%1B%5B0m'
         35        OP_DATA                                                      !0
         36        ASSIGN                                                       !0, ~18
   22    37    >   FRAMELESS_ICALL_3                in_array            ~20     '%0A', !1
         38        OP_DATA                                                      <true>
         39        TYPE_CHECK                                        4          ~20
         40      > JMPZ                                                         ~21, ->44
   23    41    >   FRAMELESS_ICALL_3                str_replace         ~22     '%0A', '%1B%5B30%3B1m%5Cn%1B%5B0m'
         42        OP_DATA                                                      !0
         43        ASSIGN                                                       !0, ~22
   26    44    >   FRAMELESS_ICALL_3                in_array            ~24     '%09', !1
         45        OP_DATA                                                      <true>
         46        TYPE_CHECK                                        4          ~24
         47      > JMPZ                                                         ~25, ->51
   27    48    >   FRAMELESS_ICALL_3                str_replace         ~26     '%09', '%1B%5B30%3B1m%5Ct%1B%5B0m'
         49        OP_DATA                                                      !0
         50        ASSIGN                                                       !0, ~26
   30    51    >   FRAMELESS_ICALL_3                in_array            ~28     '+', !1
         52        OP_DATA                                                      <true>
         53        TYPE_CHECK                                        4          ~28
         54      > JMPZ                                                         ~29, ->58
   31    55    >   FRAMELESS_ICALL_3                str_replace         ~30     '+', '%1B%5B30%3B1m%C3%82%C2%B7%1B%5B0m'
         56        OP_DATA                                                      !0
         57        ASSIGN                                                       !0, ~30
   35    58    > > RETURN                                                       !0
   37    59*     > RETURN                                                       null

End of function prepareforoutput

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
214.9 ms | 3330 KiB | 15 Q