3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.14 ms | 1394 KiB | 17 Q