3v4l.org

run code in 500+ PHP versions simultaneously
<?php function generateRandomString($length = 10) { $characters = '0123456789abcdefghijklmnopqrstuvwxyz-_.'; $charactersLength = strlen($characters); $randomString = ''; for ($i = 0; $i < $length; $i++) { $randomString .= $characters[rand(0, $charactersLength - 1)]; } return $randomString; } $unique = array(); for ($i = 0; $i < 9000000; $i++) { $u=$i+1; $random = generateRandomString(5); if(!in_array($random, $unique)){ echo $u.".m".$random."@[server]\n"; $unique[] = $random; gc_collect_cycles(); }else{ echo "duplicate detected"; $i--; } } echo memory_get_peak_usage();

Abusive script

This script was stopped while abusing our resources

Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 3
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 21
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 3
Branch analysis from position: 26
Branch analysis from position: 3
Branch analysis from position: 21
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 3
Branch analysis from position: 26
Branch analysis from position: 3
filename:       /in/AtTkO
function name:  (null)
number of ops:  30
compiled vars:  !0 = $unique, !1 = $i, !2 = $u, !3 = $random
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   12     0  E >   ASSIGN                                                       !0, <array>
   13     1        ASSIGN                                                       !1, 0
          2      > JMP                                                          ->24
   15     3    >   ADD                                                  ~6      !1, 1
          4        ASSIGN                                                       !2, ~6
   16     5        INIT_FCALL                                                   'generaterandomstring'
          6        SEND_VAL                                                     5
          7        DO_FCALL                                          0  $8      
          8        ASSIGN                                                       !3, $8
   17     9        FRAMELESS_ICALL_2                in_array            ~10     !3, !0
         10        BOOL_NOT                                             ~11     ~10
         11      > JMPZ                                                         ~11, ->21
   18    12    >   CONCAT                                               ~12     !2, '.m'
         13        CONCAT                                               ~13     ~12, !3
         14        CONCAT                                               ~14     ~13, '%40%5Bserver%5D%0A'
         15        ECHO                                                         ~14
   19    16        ASSIGN_DIM                                                   !0
         17        OP_DATA                                                      !3
   20    18        INIT_FCALL                                                   'gc_collect_cycles'
         19        DO_ICALL                                                     
   17    20      > JMP                                                          ->23
   22    21    >   ECHO                                                         'duplicate+detected'
   23    22        PRE_DEC                                                      !1
   13    23    >   PRE_INC                                                      !1
         24    >   IS_SMALLER                                                   !1, 9000000
         25      > JMPNZ                                                        ~19, ->3
   27    26    >   INIT_FCALL                                                   'memory_get_peak_usage'
         27        DO_ICALL                                             $20     
         28        ECHO                                                         $20
         29      > RETURN                                                       1

Function generaterandomstring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 7
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 7
Branch analysis from position: 17
Branch analysis from position: 7
filename:       /in/AtTkO
function name:  generateRandomString
number of ops:  19
compiled vars:  !0 = $length, !1 = $characters, !2 = $charactersLength, !3 = $randomString, !4 = $i
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   RECV_INIT                                            !0      10
    3     1        ASSIGN                                                       !1, '0123456789abcdefghijklmnopqrstuvwxyz-_.'
    4     2        STRLEN                                               ~6      !1
          3        ASSIGN                                                       !2, ~6
    5     4        ASSIGN                                                       !3, ''
    6     5        ASSIGN                                                       !4, 0
          6      > JMP                                                          ->15
    7     7    >   INIT_FCALL                                                   'rand'
          8        SEND_VAL                                                     0
          9        SUB                                                  ~10     !2, 1
         10        SEND_VAL                                                     ~10
         11        DO_ICALL                                             $11     
         12        FETCH_DIM_R                                          ~12     !1, $11
         13        ASSIGN_OP                                         8          !3, ~12
    6    14        PRE_INC                                                      !4
         15    >   IS_SMALLER                                                   !4, !0
         16      > JMPNZ                                                        ~15, ->7
    9    17    > > RETURN                                                       !3
   10    18*     > RETURN                                                       null

End of function generaterandomstring

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
169.69 ms | 1658 KiB | 17 Q