3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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
Jump found. Position 1 = -2
filename:       /in/tGuNm
function name:  (null)
number of ops:  16
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   NOP                                                      
   9     1        INIT_FCALL                                               'var_dump'
         2        INIT_FCALL                                               'modulo'
         3        SEND_VAL                                                 '3.5'
         4        SEND_VAL                                                 '4'
         5        DO_FCALL                                      0  $0      
         6        SEND_VAR                                                 $0
         7        DO_ICALL                                                 
  10     8        INIT_FCALL                                               'var_dump'
         9        INIT_FCALL                                               'modulo'
        10        SEND_VAL                                                 '1071'
        11        SEND_VAL                                                 '357.5'
        12        DO_FCALL                                      0  $2      
        13        SEND_VAR                                                 $2
        14        DO_ICALL                                                 
        15      > RETURN                                                   1

Function modulo:
Finding entry points
Branch analysis from position: 0
Jump found. 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                               4          $2
        11        SEND_VAR_EX                                              !1
        12        DO_FCALL                                      0  $3      
        13        SEND_VAR_NO_REF                               4          $3
        14        DO_FCALL                                      0  $4      
        15      > RETURN                                                   $4
   5    16*     > RETURN                                                   null

End of function modulo

Generated using Vulcan Logic Dumper, using php 7.1.0