3v4l.org

run code in 300+ PHP versions simultaneously
<?php function modulo($number, $modulus) { return bcsub($number, bcmul(bcdiv($number, $modulus, 0), $modulus)); } //bcscale(1); var_dump(modulo("3.5", "4")); var_dump(modulo("1071", "357.5"));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tGuNm
function name:  (null)
number of ops:  15
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'modulo'
          2        SEND_VAL                                                 '3.5'
          3        SEND_VAL                                                 '4'
          4        DO_FCALL                                      0  $0      
          5        SEND_VAR                                                 $0
          6        DO_ICALL                                                 
   10     7        INIT_FCALL                                               'var_dump'
          8        INIT_FCALL                                               'modulo'
          9        SEND_VAL                                                 '1071'
         10        SEND_VAL                                                 '357.5'
         11        DO_FCALL                                      0  $2      
         12        SEND_VAR                                                 $2
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

Function modulo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tGuNm
function name:  modulo
number of ops:  17
compiled vars:  !0 = $number, !1 = $modulus
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        INIT_FCALL_BY_NAME                                       'bcsub'
          3        SEND_VAR_EX                                              !0
          4        INIT_FCALL_BY_NAME                                       'bcmul'
          5        INIT_FCALL_BY_NAME                                       'bcdiv'
          6        SEND_VAR_EX                                              !0
          7        SEND_VAR_EX                                              !1
          8        SEND_VAL_EX                                              0
          9        DO_FCALL                                      0  $2      
         10        SEND_VAR_NO_REF_EX                                       $2
         11        SEND_VAR_EX                                              !1
         12        DO_FCALL                                      0  $3      
         13        SEND_VAR_NO_REF_EX                                       $3
         14        DO_FCALL                                      0  $4      
         15      > RETURN                                                   $4
    5    16*     > RETURN                                                   null

End of function modulo

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.47 ms | 1390 KiB | 26 Q