3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Point { public $X; public $Y; function __construct($X, $Y) { $this->X = $X; $this->Y = $Y; } } $moves = 10; $mouseX = 200; $mouseY = 200; $point = new Point(300, 300); $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; } echo $delta.' -> '.(1/$delta)."\r\n"; $points = array(new Point($mouseX, $mouseY)); for ( $i=1; $i<=$moves; $i++ ) { $x = $points[$i-1]->X + ($point->X - $mouseX)*$xCoefs[$i-1]/$moves; $y = $points[$i-1]->Y + ($point->Y - $mouseY)/$moves; echo $x.';'.$y.' (coef '.$xCoefs[$i-1].')'."\r\n"; $points[] = new Point($x, $y); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 24
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 37
Branch analysis from position: 37
2 jumps found. (Code = 44) Position 1 = 39, Position 2 = 28
Branch analysis from position: 39
1 jumps found. (Code = 42) Position 1 = 87
Branch analysis from position: 87
2 jumps found. (Code = 44) Position 1 = 89, Position 2 = 52
Branch analysis from position: 89
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 52
2 jumps found. (Code = 44) Position 1 = 89, Position 2 = 52
Branch analysis from position: 89
Branch analysis from position: 52
Branch analysis from position: 28
2 jumps found. (Code = 44) Position 1 = 39, Position 2 = 28
Branch analysis from position: 39
Branch analysis from position: 28
Branch analysis from position: 24
filename:       /in/bE9gq
function name:  (null)
number of ops:  90
compiled vars:  !0 = $moves, !1 = $mouseX, !2 = $mouseY, !3 = $point, !4 = $delta, !5 = $xCoefs, !6 = $i, !7 = $points, !8 = $x, !9 = $y
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   ASSIGN                                                   !0, 10
   14     1        ASSIGN                                                   !1, 200
   15     2        ASSIGN                                                   !2, 200
   16     3        NEW                                              $13     'Point'
          4        SEND_VAL_EX                                              300
          5        SEND_VAL_EX                                              300
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !3, $13
   18     8        INIT_FCALL                                               'rand'
          9        SEND_VAL                                                 0
         10        SEND_VAL                                                 99
         11        DO_ICALL                                         $16     
         12        DIV                                              ~17     $16, 100
         13        SUB                                              ~18     1, ~17
         14        DIV                                              ~19     1, ~18
         15        ASSIGN                                                   !4, ~19
   19    16        INIT_FCALL                                               'rand'
         17        SEND_VAL                                                 0
         18        SEND_VAL                                                 1
         19        DO_ICALL                                         $21     
         20        IS_EQUAL                                                 $21, 0
         21      > JMPZ                                                     ~22, ->24
   20    22    >   DIV                                              ~23     1, !4
         23        ASSIGN                                                   !4, ~23
   22    24    >   INIT_ARRAY                                       ~25     !4
         25        ASSIGN                                                   !5, ~25
   23    26        ASSIGN                                                   !6, 1
         27      > JMP                                                      ->37
   24    28    >   SUB                                              ~29     !6, 1
         29        FETCH_DIM_R                                      ~30     !5, ~29
         30        DIV                                              ~31     1, !4
         31        SUB                                              ~32     !4, ~31
         32        DIV                                              ~33     ~32, !0
         33        SUB                                              ~34     ~30, ~33
         34        ASSIGN_DIM                                               !5, !6
         35        OP_DATA                                                  ~34
   23    36        PRE_INC                                                  !6
         37    >   IS_SMALLER_OR_EQUAL                                      !6, !0
         38      > JMPNZ                                                    ~36, ->28
   26    39    >   CONCAT                                           ~37     !4, '+-%3E+'
         40        DIV                                              ~38     1, !4
         41        CONCAT                                           ~39     ~37, ~38
         42        CONCAT                                           ~40     ~39, '%0D%0A'
         43        ECHO                                                     ~40
   29    44        NEW                                              $41     'Point'
         45        SEND_VAR_EX                                              !1
         46        SEND_VAR_EX                                              !2
         47        DO_FCALL                                      0          
         48        INIT_ARRAY                                       ~43     $41
         49        ASSIGN                                                   !7, ~43
   30    50        ASSIGN                                                   !6, 1
         51      > JMP                                                      ->87
   31    52    >   SUB                                              ~46     !6, 1
         53        FETCH_DIM_R                                      ~47     !7, ~46
         54        FETCH_OBJ_R                                      ~48     ~47, 'X'
         55        FETCH_OBJ_R                                      ~49     !3, 'X'
         56        SUB                                              ~50     ~49, !1
         57        SUB                                              ~51     !6, 1
         58        FETCH_DIM_R                                      ~52     !5, ~51
         59        MUL                                              ~53     ~50, ~52
         60        DIV                                              ~54     ~53, !0
         61        ADD                                              ~55     ~48, ~54
         62        ASSIGN                                                   !8, ~55
   32    63        SUB                                              ~57     !6, 1
         64        FETCH_DIM_R                                      ~58     !7, ~57
         65        FETCH_OBJ_R                                      ~59     ~58, 'Y'
         66        FETCH_OBJ_R                                      ~60     !3, 'Y'
         67        SUB                                              ~61     ~60, !2
         68        DIV                                              ~62     ~61, !0
         69        ADD                                              ~63     ~59, ~62
         70        ASSIGN                                                   !9, ~63
   33    71        CONCAT                                           ~65     !8, '%3B'
         72        CONCAT                                           ~66     ~65, !9
         73        CONCAT                                           ~67     ~66, '+%28coef+'
         74        SUB                                              ~68     !6, 1
         75        FETCH_DIM_R                                      ~69     !5, ~68
         76        CONCAT                                           ~70     ~67, ~69
         77        CONCAT                                           ~71     ~70, '%29'
         78        CONCAT                                           ~72     ~71, '%0D%0A'
         79        ECHO                                                     ~72
   34    80        NEW                                              $74     'Point'
         81        SEND_VAR_EX                                              !8
         82        SEND_VAR_EX                                              !9
         83        DO_FCALL                                      0          
         84        ASSIGN_DIM                                               !7
         85        OP_DATA                                                  $74
   30    86        PRE_INC                                                  !6
         87    >   IS_SMALLER_OR_EQUAL                                      !6, !0
         88      > JMPNZ                                                    ~77, ->52
   35    89    > > RETURN                                                   1

Class Point:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bE9gq
function name:  __construct
number of ops:  7
compiled vars:  !0 = $X, !1 = $Y
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    8     2        ASSIGN_OBJ                                               'X'
          3        OP_DATA                                                  !0
    9     4        ASSIGN_OBJ                                               'Y'
          5        OP_DATA                                                  !1
   10     6      > RETURN                                                   null

End of function __construct

End of class Point.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.47 ms | 1404 KiB | 15 Q