3v4l.org

run code in 300+ PHP versions simultaneously
<?php $initial = rand(0, 100)/100; if ($initial < .25) { $random = rand(0, 9); } elseif ($initial < .5) { $random = rand(10, 99); } elseif ($initial < .75) { $random = rand(100, 999); } elseif ($initial >= .75) { $random = rand(1000, 99999); } var_dump($random);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 14
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 37
Branch analysis from position: 37
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 22
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 37
Branch analysis from position: 37
Branch analysis from position: 22
2 jumps found. (Code = 43) Position 1 = 24, Position 2 = 30
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 37
Branch analysis from position: 37
Branch analysis from position: 30
2 jumps found. (Code = 43) Position 1 = 32, Position 2 = 37
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 37
filename:       /in/opRPV
function name:  (null)
number of ops:  41
compiled vars:  !0 = $initial, !1 = $random
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'rand'
          1        SEND_VAL                                                 0
          2        SEND_VAL                                                 100
          3        DO_ICALL                                         $2      
          4        DIV                                              ~3      $2, 100
          5        ASSIGN                                                   !0, ~3
    3     6        IS_SMALLER                                               !0, 0.25
          7      > JMPZ                                                     ~5, ->14
    4     8    >   INIT_FCALL                                               'rand'
          9        SEND_VAL                                                 0
         10        SEND_VAL                                                 9
         11        DO_ICALL                                         $6      
         12        ASSIGN                                                   !1, $6
         13      > JMP                                                      ->37
    6    14    >   IS_SMALLER                                               !0, 0.5
         15      > JMPZ                                                     ~8, ->22
    7    16    >   INIT_FCALL                                               'rand'
         17        SEND_VAL                                                 10
         18        SEND_VAL                                                 99
         19        DO_ICALL                                         $9      
         20        ASSIGN                                                   !1, $9
         21      > JMP                                                      ->37
    9    22    >   IS_SMALLER                                               !0, 0.75
         23      > JMPZ                                                     ~11, ->30
   10    24    >   INIT_FCALL                                               'rand'
         25        SEND_VAL                                                 100
         26        SEND_VAL                                                 999
         27        DO_ICALL                                         $12     
         28        ASSIGN                                                   !1, $12
         29      > JMP                                                      ->37
   12    30    >   IS_SMALLER_OR_EQUAL                                      0.75, !0
         31      > JMPZ                                                     ~14, ->37
   13    32    >   INIT_FCALL                                               'rand'
         33        SEND_VAL                                                 1000
         34        SEND_VAL                                                 99999
         35        DO_ICALL                                         $15     
         36        ASSIGN                                                   !1, $15
   15    37    >   INIT_FCALL                                               'var_dump'
         38        SEND_VAR                                                 !1
         39        DO_ICALL                                                 
         40      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.72 ms | 1400 KiB | 17 Q