3v4l.org

run code in 300+ PHP versions simultaneously
<?php $original = 4189.94; $int = (int) round($original * 100); $float = $original * 100; var_dump($int); //should be 418,994 ?? var_dump($float); //should be 418,994 ?? var_dump($float/100); $double = $int / 100; // should be 4189.94 again ?? var_dump($double); var_dump($double == $original);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NPENE
function name:  (null)
number of ops:  29
compiled vars:  !0 = $original, !1 = $int, !2 = $float, !3 = $double
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 4189.94
    5     1        INIT_FCALL                                               'round'
          2        MUL                                              ~5      !0, 100
          3        SEND_VAL                                                 ~5
          4        DO_ICALL                                         $6      
          5        CAST                                          4  ~7      $6
          6        ASSIGN                                                   !1, ~7
    6     7        MUL                                              ~9      !0, 100
          8        ASSIGN                                                   !2, ~9
    7     9        INIT_FCALL                                               'var_dump'
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                                 
    8    12        INIT_FCALL                                               'var_dump'
         13        SEND_VAR                                                 !2
         14        DO_ICALL                                                 
    9    15        INIT_FCALL                                               'var_dump'
         16        DIV                                              ~13     !2, 100
         17        SEND_VAL                                                 ~13
         18        DO_ICALL                                                 
   11    19        DIV                                              ~15     !1, 100
         20        ASSIGN                                                   !3, ~15
   13    21        INIT_FCALL                                               'var_dump'
         22        SEND_VAR                                                 !3
         23        DO_ICALL                                                 
   15    24        INIT_FCALL                                               'var_dump'
         25        IS_EQUAL                                         ~18     !3, !0
         26        SEND_VAL                                                 ~18
         27        DO_ICALL                                                 
         28      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.34 ms | 1395 KiB | 17 Q