3v4l.org

run code in 300+ PHP versions simultaneously
<?php $moves = 10; $delta = 1/(1-rand(0, 99)/100); if (rand(0, 1) == 0) { $delta = 1/$delta; } $xCoefs = array($delta); for ( $i=1; $i<=$moves; $i++ ) { $xCoefs[$i] = $xCoefs[$i-1] - ($delta - 1/$delta)/$moves; } var_dump($xCoefs);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 17
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
2 jumps found. (Code = 44) Position 1 = 32, Position 2 = 21
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
2 jumps found. (Code = 44) Position 1 = 32, Position 2 = 21
Branch analysis from position: 32
Branch analysis from position: 21
Branch analysis from position: 17
filename:       /in/Vn14J
function name:  (null)
number of ops:  36
compiled vars:  !0 = $moves, !1 = $delta, !2 = $xCoefs, !3 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 10
    5     1        INIT_FCALL                                               'rand'
          2        SEND_VAL                                                 0
          3        SEND_VAL                                                 99
          4        DO_ICALL                                         $5      
          5        DIV                                              ~6      $5, 100
          6        SUB                                              ~7      1, ~6
          7        DIV                                              ~8      1, ~7
          8        ASSIGN                                                   !1, ~8
    6     9        INIT_FCALL                                               'rand'
         10        SEND_VAL                                                 0
         11        SEND_VAL                                                 1
         12        DO_ICALL                                         $10     
         13        IS_EQUAL                                                 $10, 0
         14      > JMPZ                                                     ~11, ->17
    7    15    >   DIV                                              ~12     1, !1
         16        ASSIGN                                                   !1, ~12
    9    17    >   INIT_ARRAY                                       ~14     !1
         18        ASSIGN                                                   !2, ~14
   10    19        ASSIGN                                                   !3, 1
         20      > JMP                                                      ->30
   11    21    >   SUB                                              ~18     !3, 1
         22        FETCH_DIM_R                                      ~19     !2, ~18
         23        DIV                                              ~20     1, !1
         24        SUB                                              ~21     !1, ~20
         25        DIV                                              ~22     ~21, !0
         26        SUB                                              ~23     ~19, ~22
         27        ASSIGN_DIM                                               !2, !3
         28        OP_DATA                                                  ~23
   10    29        PRE_INC                                                  !3
         30    >   IS_SMALLER_OR_EQUAL                                      !3, !0
         31      > JMPNZ                                                    ~25, ->21
   14    32    >   INIT_FCALL                                               'var_dump'
         33        SEND_VAR                                                 !2
         34        DO_ICALL                                                 
         35      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.54 ms | 1396 KiB | 17 Q