3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Generate a load of "random" input $strings = array_map('md5', range(1, 100)); $bucketCount = 10; $buckets = []; foreach ($strings as $string) { $key = crc32($string) % $bucketCount; $buckets[$key][] = $string; } print_r($buckets);

Abusive script

This script was stopped while abusing our resources

Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 22
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 22
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/enEEV
function name:  (null)
number of ops:  27
compiled vars:  !0 = $strings, !1 = $bucketCount, !2 = $buckets, !3 = $string, !4 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL                                               'array_map'
          1        SEND_VAL                                                 'md5'
          2        INIT_FCALL                                               'range'
          3        SEND_VAL                                                 1
          4        SEND_VAL                                                 100
          5        DO_ICALL                                         $5      
          6        SEND_VAR                                                 $5
          7        DO_ICALL                                         $6      
          8        ASSIGN                                                   !0, $6
    6     9        ASSIGN                                                   !1, 10
    8    10        ASSIGN                                                   !2, <array>
   10    11      > FE_RESET_R                                       $10     !0, ->22
         12    > > FE_FETCH_R                                               $10, !3, ->22
   11    13    >   INIT_FCALL                                               'crc32'
         14        SEND_VAR                                                 !3
         15        DO_ICALL                                         $11     
         16        MOD                                              ~12     $11, !1
         17        ASSIGN                                                   !4, ~12
   13    18        FETCH_DIM_W                                      $14     !2, !4
         19        ASSIGN_DIM                                               $14
         20        OP_DATA                                                  !3
   10    21      > JMP                                                      ->12
         22    >   FE_FREE                                                  $10
   16    23        INIT_FCALL                                               'print_r'
         24        SEND_VAR                                                 !2
         25        DO_ICALL                                                 
         26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.8 ms | 1005 KiB | 17 Q