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(((0.2 + 1.4) * 3)); // Should be 16. But it's 15! // Using BC Math var_dump(bcadd('0.2', '1.4', 2) * 3); // 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/U1EXc
function name:  (null)
number of ops:  13
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'var_dump'
          1        SEND_VAL                                                 4.8
          2        DO_ICALL                                                 
   10     3        INIT_FCALL                                               'var_dump'
          4        INIT_FCALL_BY_NAME                                       'bcadd'
          5        SEND_VAL_EX                                              '0.2'
          6        SEND_VAL_EX                                              '1.4'
          7        SEND_VAL_EX                                              2
          8        DO_FCALL                                      0  $1      
          9        MUL                                              ~2      $1, 3
         10        SEND_VAL                                                 ~2
         11        DO_ICALL                                                 
         12      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.88 ms | 1394 KiB | 18 Q