3v4l.org

run code in 300+ PHP versions simultaneously
<?php $file = file_put_contents("/tmp/myfile.txt", "testteststasfasdaskdjfbasdlkfbaslkdcjnbal;dfn"); $tmpFile = file_put_contents("/tmp/mytmpfile.txt",""); $old = fopen($file, 'r'); $new = fopen($tmpFile, 'w'); while (!feof($old)) { // Your search subject $subject = ''; // Get $numChars for($x = 0, $numChars = 100; $x < $numChars; $x++){ $subject .= fgetc($old); } // Replace and write to $new fwrite($new, preg_replace('/[^\P{Cc}\t\r\n]/u', '', $subject)); // Clean out the characters $subject = ''; } rename($tmpFile, $file);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 42
Branch analysis from position: 42
2 jumps found. (Code = 44) Position 1 = 47, Position 2 = 21
Branch analysis from position: 47
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
2 jumps found. (Code = 44) Position 1 = 32, Position 2 = 25
Branch analysis from position: 32
2 jumps found. (Code = 44) Position 1 = 47, Position 2 = 21
Branch analysis from position: 47
Branch analysis from position: 21
Branch analysis from position: 25
2 jumps found. (Code = 44) Position 1 = 32, Position 2 = 25
Branch analysis from position: 32
Branch analysis from position: 25
filename:       /in/qF7aJ
function name:  (null)
number of ops:  52
compiled vars:  !0 = $file, !1 = $tmpFile, !2 = $old, !3 = $new, !4 = $subject, !5 = $x, !6 = $numChars
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'file_put_contents'
          1        SEND_VAL                                                 '%2Ftmp%2Fmyfile.txt'
          2        SEND_VAL                                                 'testteststasfasdaskdjfbasdlkfbaslkdcjnbal%3Bdfn'
          3        DO_ICALL                                         $7      
          4        ASSIGN                                                   !0, $7
    4     5        INIT_FCALL                                               'file_put_contents'
          6        SEND_VAL                                                 '%2Ftmp%2Fmytmpfile.txt'
          7        SEND_VAL                                                 ''
          8        DO_ICALL                                         $9      
          9        ASSIGN                                                   !1, $9
    5    10        INIT_FCALL                                               'fopen'
         11        SEND_VAR                                                 !0
         12        SEND_VAL                                                 'r'
         13        DO_ICALL                                         $11     
         14        ASSIGN                                                   !2, $11
    6    15        INIT_FCALL                                               'fopen'
         16        SEND_VAR                                                 !1
         17        SEND_VAL                                                 'w'
         18        DO_ICALL                                         $13     
         19        ASSIGN                                                   !3, $13
    8    20      > JMP                                                      ->42
   10    21    >   ASSIGN                                                   !4, ''
   13    22        ASSIGN                                                   !5, 0
         23        ASSIGN                                                   !6, 100
         24      > JMP                                                      ->30
   14    25    >   INIT_FCALL                                               'fgetc'
         26        SEND_VAR                                                 !2
         27        DO_ICALL                                         $18     
         28        ASSIGN_OP                                     8          !4, $18
   13    29        PRE_INC                                                  !5
         30    >   IS_SMALLER                                               !5, !6
         31      > JMPNZ                                                    ~21, ->25
   18    32    >   INIT_FCALL                                               'fwrite'
         33        SEND_VAR                                                 !3
         34        INIT_FCALL                                               'preg_replace'
         35        SEND_VAL                                                 '%2F%5B%5E%5CP%7BCc%7D%5Ct%5Cr%5Cn%5D%2Fu'
         36        SEND_VAL                                                 ''
         37        SEND_VAR                                                 !4
         38        DO_ICALL                                         $22     
         39        SEND_VAR                                                 $22
         40        DO_ICALL                                                 
   21    41        ASSIGN                                                   !4, ''
    8    42    >   INIT_FCALL                                               'feof'
         43        SEND_VAR                                                 !2
         44        DO_ICALL                                         $25     
         45        BOOL_NOT                                         ~26     $25
         46      > JMPNZ                                                    ~26, ->21
   24    47    >   INIT_FCALL                                               'rename'
         48        SEND_VAR                                                 !1
         49        SEND_VAR                                                 !0
         50        DO_ICALL                                                 
         51      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.18 ms | 1400 KiB | 27 Q