3v4l.org

run code in 300+ PHP versions simultaneously
<?php function str_hash($str, $range=100){ $number = crc32($str); return $number % $range; } /* $hash = md5("ececa23f92d363f2471a5255b878ff4375960be4695f3dd8afe39a17428f4f24"); echo base_convert($hash, 16, 10); */ $hash = "ececa23f92d363f2471a5255b878ff4375960be4695f3dd8afe39a17428f4f24"; echo str_hash($hash, 5);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WFmRQ
function name:  (null)
number of ops:  7
compiled vars:  !0 = $hash
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   ASSIGN                                                   !0, 'ececa23f92d363f2471a5255b878ff4375960be4695f3dd8afe39a17428f4f24'
   16     1        INIT_FCALL                                               'str_hash'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 5
          4        DO_FCALL                                      0  $2      
          5        ECHO                                                     $2
          6      > RETURN                                                   1

Function str_hash:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WFmRQ
function name:  str_hash
number of ops:  9
compiled vars:  !0 = $str, !1 = $range, !2 = $number
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      100
    4     2        INIT_FCALL                                               'crc32'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $3      
          5        ASSIGN                                                   !2, $3
    5     6        MOD                                              ~5      !2, !1
          7      > RETURN                                                   ~5
    6     8*     > RETURN                                                   null

End of function str_hash

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
190.77 ms | 1397 KiB | 16 Q