3v4l.org

run code in 300+ PHP versions simultaneously
<?php $uid=8193; function q4() { global $uid; srand($uid);rand(1,100);rand(1,100);rand(1,100);rand(1,20);rand(100,1000); $h=rand(10,1000); $n=rand(1,10); $r=$h+1;$k=0; for($i=1;$i<=$n;$i++) { $r=ceil($r/2); $k++; } $k+=$r-1; return $k; } echo q4();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0ntUI
function name:  (null)
number of ops:  5
compiled vars:  !0 = $uid
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 8193
   19     1        INIT_FCALL                                               'q4'
          2        DO_FCALL                                      0  $2      
          3        ECHO                                                     $2
          4      > RETURN                                                   1

Function q4:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 46
Branch analysis from position: 46
2 jumps found. (Code = 44) Position 1 = 48, Position 2 = 39
Branch analysis from position: 48
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 39
2 jumps found. (Code = 44) Position 1 = 48, Position 2 = 39
Branch analysis from position: 48
Branch analysis from position: 39
filename:       /in/0ntUI
function name:  q4
number of ops:  52
compiled vars:  !0 = $uid, !1 = $h, !2 = $n, !3 = $r, !4 = $k, !5 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   BIND_GLOBAL                                              !0, 'uid'
    6     1        INIT_FCALL                                               'srand'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
          4        INIT_FCALL                                               'rand'
          5        SEND_VAL                                                 1
          6        SEND_VAL                                                 100
          7        DO_ICALL                                                 
          8        INIT_FCALL                                               'rand'
          9        SEND_VAL                                                 1
         10        SEND_VAL                                                 100
         11        DO_ICALL                                                 
         12        INIT_FCALL                                               'rand'
         13        SEND_VAL                                                 1
         14        SEND_VAL                                                 100
         15        DO_ICALL                                                 
         16        INIT_FCALL                                               'rand'
         17        SEND_VAL                                                 1
         18        SEND_VAL                                                 20
         19        DO_ICALL                                                 
         20        INIT_FCALL                                               'rand'
         21        SEND_VAL                                                 100
         22        SEND_VAL                                                 1000
         23        DO_ICALL                                                 
    8    24        INIT_FCALL                                               'rand'
         25        SEND_VAL                                                 10
         26        SEND_VAL                                                 1000
         27        DO_ICALL                                         $12     
         28        ASSIGN                                                   !1, $12
    9    29        INIT_FCALL                                               'rand'
         30        SEND_VAL                                                 1
         31        SEND_VAL                                                 10
         32        DO_ICALL                                         $14     
         33        ASSIGN                                                   !2, $14
   10    34        ADD                                              ~16     !1, 1
         35        ASSIGN                                                   !3, ~16
         36        ASSIGN                                                   !4, 0
   11    37        ASSIGN                                                   !5, 1
         38      > JMP                                                      ->46
   13    39    >   INIT_FCALL                                               'ceil'
         40        DIV                                              ~20     !3, 2
         41        SEND_VAL                                                 ~20
         42        DO_ICALL                                         $21     
         43        ASSIGN                                                   !3, $21
   14    44        PRE_INC                                                  !4
   11    45        PRE_INC                                                  !5
         46    >   IS_SMALLER_OR_EQUAL                                      !5, !2
         47      > JMPNZ                                                    ~25, ->39
   16    48    >   SUB                                              ~26     !3, 1
         49        ASSIGN_OP                                     1          !4, ~26
   17    50      > RETURN                                                   !4
   18    51*     > RETURN                                                   null

End of function q4

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.81 ms | 1403 KiB | 20 Q