3v4l.org

run code in 300+ PHP versions simultaneously
<?php $number = 3.0000000000000000000000002; $delta = 0.00000001; $rounded = round($number, 6); if (abs($number -$rounded) < $delta) { $result = intval($number); } echo "Rounded result: ".$result.PHP_EOL;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 15
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/Hasd6
function name:  (null)
number of ops:  19
compiled vars:  !0 = $number, !1 = $delta, !2 = $rounded, !3 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 3
    5     1        ASSIGN                                                   !1, 1.0e-8
    9     2        INIT_FCALL                                               'round'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 6
          5        DO_ICALL                                         $6      
          6        ASSIGN                                                   !2, $6
   11     7        INIT_FCALL                                               'abs'
          8        SUB                                              ~8      !0, !2
          9        SEND_VAL                                                 ~8
         10        DO_ICALL                                         $9      
         11        IS_SMALLER                                               $9, !1
         12      > JMPZ                                                     ~10, ->15
   12    13    >   CAST                                          4  ~11     !0
         14        ASSIGN                                                   !3, ~11
   17    15    >   CONCAT                                           ~13     'Rounded+result%3A+', !3
         16        CONCAT                                           ~14     ~13, '%0A'
         17        ECHO                                                     ~14
         18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.86 ms | 1395 KiB | 17 Q