3v4l.org

run code in 300+ PHP versions simultaneously
<?php $n = 0 - 0.0000000000000001; var_dump($n); // float(-1.0E-33) var_dump(round($n)); // float(-0) -- huh?! var_dump(abs($n)); // float(1.0E-33) var_dump(abs(round($n))); // float(0) var_dump(round($n) == 0); // bool(true) var_dump(round($n) === 0); // bool(false)
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/51Eal
function name:  (null)
number of ops:  40
compiled vars:  !0 = $n
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, -1.0e-16
    5     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
    6     4        INIT_FCALL                                               'var_dump'
          5        INIT_FCALL                                               'round'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $3      
          8        SEND_VAR                                                 $3
          9        DO_ICALL                                                 
    7    10        INIT_FCALL                                               'var_dump'
         11        INIT_FCALL                                               'abs'
         12        SEND_VAR                                                 !0
         13        DO_ICALL                                         $5      
         14        SEND_VAR                                                 $5
         15        DO_ICALL                                                 
    8    16        INIT_FCALL                                               'var_dump'
         17        INIT_FCALL                                               'abs'
         18        INIT_FCALL                                               'round'
         19        SEND_VAR                                                 !0
         20        DO_ICALL                                         $7      
         21        SEND_VAR                                                 $7
         22        DO_ICALL                                         $8      
         23        SEND_VAR                                                 $8
         24        DO_ICALL                                                 
    9    25        INIT_FCALL                                               'var_dump'
         26        INIT_FCALL                                               'round'
         27        SEND_VAR                                                 !0
         28        DO_ICALL                                         $10     
         29        IS_EQUAL                                         ~11     $10, 0
         30        SEND_VAL                                                 ~11
         31        DO_ICALL                                                 
   10    32        INIT_FCALL                                               'var_dump'
         33        INIT_FCALL                                               'round'
         34        SEND_VAR                                                 !0
         35        DO_ICALL                                         $13     
         36        IS_IDENTICAL                                     ~14     $13, 0
         37        SEND_VAL                                                 ~14
         38        DO_ICALL                                                 
         39      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.33 ms | 1396 KiB | 19 Q