3v4l.org

run code in 300+ PHP versions simultaneously
<?php $original = (double) 4189.94; $int = (int) ($original * 100); //should be 418,994 ?? var_dump($int); $double = (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/Dk7Le
function name:  (null)
number of ops:  19
compiled vars:  !0 = $original, !1 = $int, !2 = $double
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   CAST                                          5  ~3      4189.94
          1        ASSIGN                                                   !0, ~3
    5     2        MUL                                              ~5      !0, 100
          3        CAST                                          4  ~6      ~5
          4        ASSIGN                                                   !1, ~6
    7     5        INIT_FCALL                                               'var_dump'
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                                 
    9     8        CAST                                          5  ~9      !1
          9        DIV                                              ~10     ~9, 100
         10        ASSIGN                                                   !2, ~10
   11    11        INIT_FCALL                                               'var_dump'
         12        SEND_VAR                                                 !2
         13        DO_ICALL                                                 
   13    14        INIT_FCALL                                               'var_dump'
         15        IS_EQUAL                                         ~13     !2, !0
         16        SEND_VAL                                                 ~13
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
240.93 ms | 1399 KiB | 15 Q