3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test($logfile) { $chars = '0123456789abcdefghijklmnopqrstuvwxyz'; $base = mt_rand(2, 36); $len = mt_rand(10, 100); $str = ''; for ($i = 0; $i < $len; ++$i) { $str .= $chars[mt_rand(0, $base - 1)]; } $gmp = gmp_init($str, $base); $val = gmp_strval($str, $base); $val = str_pad($val, strlen($str), '0', STR_PAD_LEFT); if ($val !== $str) { throw new Exception('Not same - base '.$base."\n-".$str."\n+".$val); } } for($i = 0; $i < 100000; ++$i) { test($logfile); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 8, Position 2 = 2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 2
2 jumps found. (Code = 44) Position 1 = 8, Position 2 = 2
Branch analysis from position: 8
Branch analysis from position: 2
filename:       /in/oLNjU
function name:  (null)
number of ops:  9
compiled vars:  !0 = $i, !1 = $logfile
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   ASSIGN                                                   !0, 0
          1      > JMP                                                      ->6
   19     2    >   INIT_FCALL                                               'test'
          3        SEND_VAR                                                 !1
          4        DO_FCALL                                      0          
   18     5        PRE_INC                                                  !0
          6    >   IS_SMALLER                                               !0, 100000
          7      > JMPNZ                                                    ~5, ->2
   20     8    > > RETURN                                                   1

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
2 jumps found. (Code = 44) Position 1 = 25, Position 2 = 15
Branch analysis from position: 25
2 jumps found. (Code = 43) Position 1 = 45, Position 2 = 54
Branch analysis from position: 45
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 54
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 25, Position 2 = 15
Branch analysis from position: 25
Branch analysis from position: 15
filename:       /in/oLNjU
function name:  test
number of ops:  55
compiled vars:  !0 = $logfile, !1 = $chars, !2 = $base, !3 = $len, !4 = $str, !5 = $i, !6 = $gmp, !7 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        ASSIGN                                                   !1, '0123456789abcdefghijklmnopqrstuvwxyz'
    4     2        INIT_FCALL                                               'mt_rand'
          3        SEND_VAL                                                 2
          4        SEND_VAL                                                 36
          5        DO_ICALL                                         $9      
          6        ASSIGN                                                   !2, $9
    5     7        INIT_FCALL                                               'mt_rand'
          8        SEND_VAL                                                 10
          9        SEND_VAL                                                 100
         10        DO_ICALL                                         $11     
         11        ASSIGN                                                   !3, $11
    6    12        ASSIGN                                                   !4, ''
    7    13        ASSIGN                                                   !5, 0
         14      > JMP                                                      ->23
    8    15    >   INIT_FCALL                                               'mt_rand'
         16        SEND_VAL                                                 0
         17        SUB                                              ~15     !2, 1
         18        SEND_VAL                                                 ~15
         19        DO_ICALL                                         $16     
         20        FETCH_DIM_R                                      ~17     !1, $16
         21        ASSIGN_OP                                     8          !4, ~17
    7    22        PRE_INC                                                  !5
         23    >   IS_SMALLER                                               !5, !3
         24      > JMPNZ                                                    ~20, ->15
   10    25    >   INIT_FCALL_BY_NAME                                       'gmp_init'
         26        SEND_VAR_EX                                              !4
         27        SEND_VAR_EX                                              !2
         28        DO_FCALL                                      0  $21     
         29        ASSIGN                                                   !6, $21
   11    30        INIT_FCALL_BY_NAME                                       'gmp_strval'
         31        SEND_VAR_EX                                              !4
         32        SEND_VAR_EX                                              !2
         33        DO_FCALL                                      0  $23     
         34        ASSIGN                                                   !7, $23
   12    35        INIT_FCALL                                               'str_pad'
         36        SEND_VAR                                                 !7
         37        STRLEN                                           ~25     !4
         38        SEND_VAL                                                 ~25
         39        SEND_VAL                                                 '0'
         40        SEND_VAL                                                 0
         41        DO_ICALL                                         $26     
         42        ASSIGN                                                   !7, $26
   13    43        IS_NOT_IDENTICAL                                         !7, !4
         44      > JMPZ                                                     ~28, ->54
   14    45    >   NEW                                              $29     'Exception'
         46        CONCAT                                           ~30     'Not+same+-+base+', !2
         47        CONCAT                                           ~31     ~30, '%0A-'
         48        CONCAT                                           ~32     ~31, !4
         49        CONCAT                                           ~33     ~32, '%0A%2B'
         50        CONCAT                                           ~34     ~33, !7
         51        SEND_VAL_EX                                              ~34
         52        DO_FCALL                                      0          
         53      > THROW                                         0          $29
   16    54    > > RETURN                                                   null

End of function test

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.05 ms | 1403 KiB | 18 Q