3v4l.org

run code in 300+ PHP versions simultaneously
<?php $moves = 10; $startAngle = rand(0, 90); $angles = array($startAngle); for ( $i=1; $i<$moves; $i++ ) { $angles[$i] = $angles[$i-1] + (90 - 2*$startAngle)/($moves-1); } var_dump($angles);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 10
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 10
Branch analysis from position: 22
Branch analysis from position: 10
filename:       /in/nMoM6
function name:  (null)
number of ops:  26
compiled vars:  !0 = $moves, !1 = $startAngle, !2 = $angles, !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                                                 90
          4        DO_ICALL                                         $5      
          5        ASSIGN                                                   !1, $5
    7     6        INIT_ARRAY                                       ~7      !1
          7        ASSIGN                                                   !2, ~7
    8     8        ASSIGN                                                   !3, 1
          9      > JMP                                                      ->20
    9    10    >   SUB                                              ~11     !3, 1
         11        FETCH_DIM_R                                      ~12     !2, ~11
         12        MUL                                              ~13     !1, 2
         13        SUB                                              ~14     90, ~13
         14        SUB                                              ~15     !0, 1
         15        DIV                                              ~16     ~14, ~15
         16        ADD                                              ~17     ~12, ~16
         17        ASSIGN_DIM                                               !2, !3
         18        OP_DATA                                                  ~17
    8    19        PRE_INC                                                  !3
         20    >   IS_SMALLER                                               !3, !0
         21      > JMPNZ                                                    ~19, ->10
   12    22    >   INIT_FCALL                                               'var_dump'
         23        SEND_VAR                                                 !2
         24        DO_ICALL                                                 
         25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.65 ms | 1395 KiB | 17 Q