3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * @see https://community.developer.authorize.net/t5/The-Authorize-Net-Developer-Blog/Precision-Math-with-PHP/ba-p/8368 */ var_dump(floor((0.2 + 1.4) * 10)); // Should be 16. But it's 15! var_dump(floor(16)); // Using BC Math var_dump(bcadd('0.2', '1.4', 2) * 10); // It's 16 like we would expect it to be.
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/c3sjK
function name:  (null)
number of ops:  22
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'floor'
          2        SEND_VAL                                                 16
          3        DO_ICALL                                         $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
    8     6        INIT_FCALL                                               'var_dump'
          7        INIT_FCALL                                               'floor'
          8        SEND_VAL                                                 16
          9        DO_ICALL                                         $2      
         10        SEND_VAR                                                 $2
         11        DO_ICALL                                                 
   11    12        INIT_FCALL                                               'var_dump'
         13        INIT_FCALL_BY_NAME                                       'bcadd'
         14        SEND_VAL_EX                                              '0.2'
         15        SEND_VAL_EX                                              '1.4'
         16        SEND_VAL_EX                                              2
         17        DO_FCALL                                      0  $4      
         18        MUL                                              ~5      $4, 10
         19        SEND_VAL                                                 ~5
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.46 ms | 1395 KiB | 17 Q