3v4l.org

run code in 300+ PHP versions simultaneously
<?php $post_max_size = 8 * 1024 * 1024; function generateFile($filename, $width, $lines, $type = 'binary-text') { $text = ''; $t0 = microtime(TRUE); for ($i = 0; $i < $lines; $i++) { // Generate $width - 1 characters to leave space for the "\n" character. for ($j = 0; $j < $width - 1; $j++) { switch ($type) { case 'text': $text .= chr(rand(32, 126)); break; case 'binary': $text .= chr(rand(0, 31)); break; case 'binary-text': default: $text .= rand(0, 1); break; } } $text .= "\n"; $t1 = microtime(TRUE); print "Iteration $i - " . (($t1 - $t0) * 1000) . ' ms' . "\n"; $t0 = $t1; } // Create filename. $filename = '/tmp/' . $filename . '.txt'; //file_put_contents($filename, $text); return $filename; } echo generateFile('exceeding_post_max_size', ceil(($post_max_size + 1024) / 1024), 1024);

Abusive script

This script was stopped while abusing our resources

Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WciJK
function name:  (null)
number of ops:  13
compiled vars:  !0 = $post_max_size
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 8388608
   39     1        INIT_FCALL                                               'generatefile'
          2        SEND_VAL                                                 'exceeding_post_max_size'
          3        INIT_FCALL                                               'ceil'
          4        ADD                                              ~2      !0, 1024
          5        DIV                                              ~3      ~2, 1024
          6        SEND_VAL                                                 ~3
          7        DO_ICALL                                         $4      
          8        SEND_VAR                                                 $4
          9        SEND_VAL                                                 1024
         10        DO_FCALL                                      0  $5      
         11        ECHO                                                     $5
         12      > RETURN                                                   1

Function generatefile:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 65
Branch analysis from position: 65
2 jumps found. (Code = 44) Position 1 = 67, Position 2 = 11
Branch analysis from position: 67
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 46
Branch analysis from position: 46
2 jumps found. (Code = 44) Position 1 = 49, Position 2 = 13
Branch analysis from position: 49
2 jumps found. (Code = 44) Position 1 = 67, Position 2 = 11
Branch analysis from position: 67
Branch analysis from position: 11
Branch analysis from position: 13
5 jumps found. (Code = 188) Position 1 = 21, Position 2 = 30, Position 3 = 39, Position 4 = 39, Position 5 = 14
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 45
Branch analysis from position: 45
2 jumps found. (Code = 44) Position 1 = 49, Position 2 = 13
Branch analysis from position: 49
Branch analysis from position: 13
Branch analysis from position: 30
1 jumps found. (Code = 42) Position 1 = 45
Branch analysis from position: 45
Branch analysis from position: 39
1 jumps found. (Code = 42) Position 1 = 45
Branch analysis from position: 45
Branch analysis from position: 39
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 21
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 30
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 39
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 39
Branch analysis from position: 39
Branch analysis from position: 39
Branch analysis from position: 30
Branch analysis from position: 21
filename:       /in/WciJK
function name:  generateFile
number of ops:  72
compiled vars:  !0 = $filename, !1 = $width, !2 = $lines, !3 = $type, !4 = $text, !5 = $t0, !6 = $i, !7 = $j, !8 = $t1
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV_INIT                                        !3      'binary-text'
    6     4        ASSIGN                                                   !4, ''
    7     5        INIT_FCALL                                               'microtime'
          6        SEND_VAL                                                 <true>
          7        DO_ICALL                                         $10     
          8        ASSIGN                                                   !5, $10
    9     9        ASSIGN                                                   !6, 0
         10      > JMP                                                      ->65
   11    11    >   ASSIGN                                                   !7, 0
         12      > JMP                                                      ->46
   12    13    > > SWITCH_STRING                                            !3, [ 'text':->21, 'binary':->30, 'binary-text':->39, ], ->39
   13    14    >   IS_EQUAL                                                 !3, 'text'
         15      > JMPNZ                                                    ~14, ->21
   17    16    >   IS_EQUAL                                                 !3, 'binary'
         17      > JMPNZ                                                    ~14, ->30
   21    18    >   IS_EQUAL                                                 !3, 'binary-text'
         19      > JMPNZ                                                    ~14, ->39
         20    > > JMP                                                      ->39
   14    21    >   INIT_FCALL                                               'chr'
         22        INIT_FCALL                                               'rand'
         23        SEND_VAL                                                 32
         24        SEND_VAL                                                 126
         25        DO_ICALL                                         $15     
         26        SEND_VAR                                                 $15
         27        DO_ICALL                                         $16     
         28        ASSIGN_OP                                     8          !4, $16
   15    29      > JMP                                                      ->45
   18    30    >   INIT_FCALL                                               'chr'
         31        INIT_FCALL                                               'rand'
         32        SEND_VAL                                                 0
         33        SEND_VAL                                                 31
         34        DO_ICALL                                         $18     
         35        SEND_VAR                                                 $18
         36        DO_ICALL                                         $19     
         37        ASSIGN_OP                                     8          !4, $19
   19    38      > JMP                                                      ->45
   23    39    >   INIT_FCALL                                               'rand'
         40        SEND_VAL                                                 0
         41        SEND_VAL                                                 1
         42        DO_ICALL                                         $21     
         43        ASSIGN_OP                                     8          !4, $21
   24    44      > JMP                                                      ->45
   11    45    >   PRE_INC                                                  !7
         46    >   SUB                                              ~24     !1, 1
         47        IS_SMALLER                                               !7, ~24
         48      > JMPNZ                                                    ~25, ->13
   27    49    >   ASSIGN_OP                                     8          !4, '%0A'
   28    50        INIT_FCALL                                               'microtime'
         51        SEND_VAL                                                 <true>
         52        DO_ICALL                                         $27     
         53        ASSIGN                                                   !8, $27
   29    54        ROPE_INIT                                     3  ~30     'Iteration+'
         55        ROPE_ADD                                      1  ~30     ~30, !6
         56        ROPE_END                                      2  ~29     ~30, '+-+'
         57        SUB                                              ~32     !8, !5
         58        MUL                                              ~33     ~32, 1000
         59        CONCAT                                           ~34     ~29, ~33
         60        CONCAT                                           ~35     ~34, '+ms'
         61        CONCAT                                           ~36     ~35, '%0A'
         62        ECHO                                                     ~36
   30    63        ASSIGN                                                   !5, !8
    9    64        PRE_INC                                                  !6
         65    >   IS_SMALLER                                               !6, !2
         66      > JMPNZ                                                    ~39, ->11
   34    67    >   CONCAT                                           ~40     '%2Ftmp%2F', !0
         68        CONCAT                                           ~41     ~40, '.txt'
         69        ASSIGN                                                   !0, ~41
   36    70      > RETURN                                                   !0
   37    71*     > RETURN                                                   null

End of function generatefile

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
130.29 ms | 1451 KiB | 18 Q