3v4l.org

run code in 300+ 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 = 48
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 21
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 28, Position 2 = 34
Branch analysis from position: 28
2 jumps found. (Code = 43) Position 1 = 41, Position 2 = 47
Branch analysis from position: 41
1 jumps found. (Code = 42) Position 1 = 100
Branch analysis from position: 100
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 47
Branch analysis from position: 34
Branch analysis from position: 21
Branch analysis from position: 48
2 jumps found. (Code = 43) Position 1 = 55, Position 2 = 61
Branch analysis from position: 55
2 jumps found. (Code = 43) Position 1 = 68, Position 2 = 74
Branch analysis from position: 68
2 jumps found. (Code = 43) Position 1 = 81, Position 2 = 87
Branch analysis from position: 81
2 jumps found. (Code = 43) Position 1 = 94, Position 2 = 100
Branch analysis from position: 94
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 100
Branch analysis from position: 87
Branch analysis from position: 74
Branch analysis from position: 61
filename:       /in/E3bVW
function name:  prepareForOutput
number of ops:  102
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, ->48
    6     8    >   INIT_FCALL                                               'in_array'
          9        SEND_VAL                                                 '%0D'
         10        SEND_VAR                                                 !1
         11        SEND_VAL                                                 <true>
         12        DO_ICALL                                         $4      
         13        TYPE_CHECK                                    4          $4
         14      > JMPZ                                                     ~5, ->21
    7    15    >   INIT_FCALL                                               'str_replace'
         16        SEND_VAL                                                 '%0D'
         17        SEND_VAL                                                 '%5Cr'
         18        SEND_VAR                                                 !0
         19        DO_ICALL                                         $6      
         20        ASSIGN                                                   !0, $6
   10    21    >   INIT_FCALL                                               'in_array'
         22        SEND_VAL                                                 '%0A'
         23        SEND_VAR                                                 !1
         24        SEND_VAL                                                 <true>
         25        DO_ICALL                                         $8      
         26        TYPE_CHECK                                    4          $8
         27      > JMPZ                                                     ~9, ->34
   11    28    >   INIT_FCALL                                               'str_replace'
         29        SEND_VAL                                                 '%0A'
         30        SEND_VAL                                                 '%5Cn'
         31        SEND_VAR                                                 !0
         32        DO_ICALL                                         $10     
         33        ASSIGN                                                   !0, $10
   14    34    >   INIT_FCALL                                               'in_array'
         35        SEND_VAL                                                 '%09'
         36        SEND_VAR                                                 !1
         37        SEND_VAL                                                 <true>
         38        DO_ICALL                                         $12     
         39        TYPE_CHECK                                    4          $12
         40      > JMPZ                                                     ~13, ->47
   15    41    >   INIT_FCALL                                               'str_replace'
         42        SEND_VAL                                                 '%09'
         43        SEND_VAL                                                 '%5Ct'
         44        SEND_VAR                                                 !0
         45        DO_ICALL                                         $14     
         46        ASSIGN                                                   !0, $14
    5    47    > > JMP                                                      ->100
   18    48    >   INIT_FCALL                                               'in_array'
         49        SEND_VAL                                                 '%0D'
         50        SEND_VAR                                                 !1
         51        SEND_VAL                                                 <true>
         52        DO_ICALL                                         $16     
         53        TYPE_CHECK                                    4          $16
         54      > JMPZ                                                     ~17, ->61
   19    55    >   INIT_FCALL                                               'str_replace'
         56        SEND_VAL                                                 '%0D'
         57        SEND_VAL                                                 '%1B%5B30%3B1m%5Cr%1B%5B0m'
         58        SEND_VAR                                                 !0
         59        DO_ICALL                                         $18     
         60        ASSIGN                                                   !0, $18
   22    61    >   INIT_FCALL                                               'in_array'
         62        SEND_VAL                                                 '%0A'
         63        SEND_VAR                                                 !1
         64        SEND_VAL                                                 <true>
         65        DO_ICALL                                         $20     
         66        TYPE_CHECK                                    4          $20
         67      > JMPZ                                                     ~21, ->74
   23    68    >   INIT_FCALL                                               'str_replace'
         69        SEND_VAL                                                 '%0A'
         70        SEND_VAL                                                 '%1B%5B30%3B1m%5Cn%1B%5B0m'
         71        SEND_VAR                                                 !0
         72        DO_ICALL                                         $22     
         73        ASSIGN                                                   !0, $22
   26    74    >   INIT_FCALL                                               'in_array'
         75        SEND_VAL                                                 '%09'
         76        SEND_VAR                                                 !1
         77        SEND_VAL                                                 <true>
         78        DO_ICALL                                         $24     
         79        TYPE_CHECK                                    4          $24
         80      > JMPZ                                                     ~25, ->87
   27    81    >   INIT_FCALL                                               'str_replace'
         82        SEND_VAL                                                 '%09'
         83        SEND_VAL                                                 '%1B%5B30%3B1m%5Ct%1B%5B0m'
         84        SEND_VAR                                                 !0
         85        DO_ICALL                                         $26     
         86        ASSIGN                                                   !0, $26
   30    87    >   INIT_FCALL                                               'in_array'
         88        SEND_VAL                                                 '+'
         89        SEND_VAR                                                 !1
         90        SEND_VAL                                                 <true>
         91        DO_ICALL                                         $28     
         92        TYPE_CHECK                                    4          $28
         93      > JMPZ                                                     ~29, ->100
   31    94    >   INIT_FCALL                                               'str_replace'
         95        SEND_VAL                                                 '+'
         96        SEND_VAL                                                 '%1B%5B30%3B1m%C3%82%C2%B7%1B%5B0m'
         97        SEND_VAR                                                 !0
         98        DO_ICALL                                         $30     
         99        ASSIGN                                                   !0, $30
   35   100    > > RETURN                                                   !0
   37   101*     > RETURN                                                   null

End of function prepareforoutput

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.81 ms | 1011 KiB | 17 Q