3v4l.org

run code in 300+ PHP versions simultaneously
<?php function bin2ascii($input) { $hextab = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; $result = ''; for ($x=0; $x<strlen($input); $x++) { $result .= $hextab[ord($input[$x]) % 62]; } return $result; } $results = array(); for ($i = 0; $i < 10000; $i++) { $val = bin2ascii(random_bytes(2)); $val = substr($val, 0, 2); if (empty($results[$val])) { $results[$val] = 1; } else { $results[$val] = $results[$val] + 1; } } arsort($results); print_r($results);

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 = 26
Branch analysis from position: 26
2 jumps found. (Code = 44) Position 1 = 28, Position 2 = 3
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 21
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
2 jumps found. (Code = 44) Position 1 = 28, Position 2 = 3
Branch analysis from position: 28
Branch analysis from position: 3
Branch analysis from position: 21
2 jumps found. (Code = 44) Position 1 = 28, Position 2 = 3
Branch analysis from position: 28
Branch analysis from position: 3
filename:       /in/VmJAa
function name:  (null)
number of ops:  35
compiled vars:  !0 = $results, !1 = $i, !2 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   ASSIGN                                                   !0, <array>
   14     1        ASSIGN                                                   !1, 0
          2      > JMP                                                      ->26
   15     3    >   INIT_FCALL                                               'bin2ascii'
          4        INIT_FCALL                                               'random_bytes'
          5        SEND_VAL                                                 2
          6        DO_ICALL                                         $5      
          7        SEND_VAR                                                 $5
          8        DO_FCALL                                      0  $6      
          9        ASSIGN                                                   !2, $6
   16    10        INIT_FCALL                                               'substr'
         11        SEND_VAR                                                 !2
         12        SEND_VAL                                                 0
         13        SEND_VAL                                                 2
         14        DO_ICALL                                         $8      
         15        ASSIGN                                                   !2, $8
   17    16        ISSET_ISEMPTY_DIM_OBJ                         1          !0, !2
         17      > JMPZ                                                     ~10, ->21
   18    18    >   ASSIGN_DIM                                               !0, !2
         19        OP_DATA                                                  1
   17    20      > JMP                                                      ->25
   20    21    >   FETCH_DIM_R                                      ~13     !0, !2
         22        ADD                                              ~14     ~13, 1
         23        ASSIGN_DIM                                               !0, !2
         24        OP_DATA                                                  ~14
   14    25    >   PRE_INC                                                  !1
         26    >   IS_SMALLER                                               !1, 10000
         27      > JMPNZ                                                    ~16, ->3
   24    28    >   INIT_FCALL                                               'arsort'
         29        SEND_REF                                                 !0
         30        DO_ICALL                                                 
   25    31        INIT_FCALL                                               'print_r'
         32        SEND_VAR                                                 !0
         33        DO_ICALL                                                 
         34      > RETURN                                                   1

Function bin2ascii:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 5
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 5
Branch analysis from position: 16
Branch analysis from position: 5
filename:       /in/VmJAa
function name:  bin2ascii
number of ops:  18
compiled vars:  !0 = $input, !1 = $hextab, !2 = $result, !3 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        ASSIGN                                                   !1, '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
    6     2        ASSIGN                                                   !2, ''
    7     3        ASSIGN                                                   !3, 0
          4      > JMP                                                      ->13
    8     5    >   INIT_FCALL                                               'ord'
          6        FETCH_DIM_R                                      ~7      !0, !3
          7        SEND_VAL                                                 ~7
          8        DO_ICALL                                         $8      
          9        MOD                                              ~9      $8, 62
         10        FETCH_DIM_R                                      ~10     !1, ~9
         11        ASSIGN_OP                                     8          !2, ~10
    7    12        PRE_INC                                                  !3
         13    >   STRLEN                                           ~13     !0
         14        IS_SMALLER                                               !3, ~13
         15      > JMPNZ                                                    ~14, ->5
   10    16    > > RETURN                                                   !2
   11    17*     > RETURN                                                   null

End of function bin2ascii

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.18 ms | 1092 KiB | 19 Q