3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo $this->roundDownToAny(10, 5); function roundDownToAny($n,$x=5) { return round(($n-$x/2)/$x)*$x; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/L6Bmp
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   FETCH_THIS                                       $0      
          1        INIT_METHOD_CALL                                         $0, 'roundDownToAny'
          2        SEND_VAL_EX                                              10
          3        SEND_VAL_EX                                              5
          4        DO_FCALL                                      0  $1      
          5        ECHO                                                     $1
    6     6      > RETURN                                                   1

Function rounddowntoany:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/L6Bmp
function name:  roundDownToAny
number of ops:  11
compiled vars:  !0 = $n, !1 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      5
    5     2        INIT_FCALL                                               'round'
          3        DIV                                              ~2      !1, 2
          4        SUB                                              ~3      !0, ~2
          5        DIV                                              ~4      ~3, !1
          6        SEND_VAL                                                 ~4
          7        DO_ICALL                                         $5      
          8        MUL                                              ~6      !1, $5
          9      > RETURN                                                   ~6
    6    10*     > RETURN                                                   null

End of function rounddowntoany

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.04 ms | 1395 KiB | 15 Q