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) { $roundedResult = intval($number); } if ((int) $number == $number){ $intedResult = (int) $number; } echo "Rounded result: ".$roundedResult.PHP_EOL; echo "Inted result: ".$intedResult.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
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 20
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
Branch analysis from position: 15
filename:       /in/0NQrj
function name:  (null)
number of ops:  27
compiled vars:  !0 = $number, !1 = $delta, !2 = $rounded, !3 = $roundedResult, !4 = $intedResult
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                                         $7      
          6        ASSIGN                                                   !2, $7
   11     7        INIT_FCALL                                               'abs'
          8        SUB                                              ~9      !0, !2
          9        SEND_VAL                                                 ~9
         10        DO_ICALL                                         $10     
         11        IS_SMALLER                                               $10, !1
         12      > JMPZ                                                     ~11, ->15
   12    13    >   CAST                                          4  ~12     !0
         14        ASSIGN                                                   !3, ~12
   17    15    >   CAST                                          4  ~14     !0
         16        IS_EQUAL                                                 !0, ~14
         17      > JMPZ                                                     ~15, ->20
   18    18    >   CAST                                          4  ~16     !0
         19        ASSIGN                                                   !4, ~16
   23    20    >   CONCAT                                           ~18     'Rounded+result%3A+', !3
         21        CONCAT                                           ~19     ~18, '%0A'
         22        ECHO                                                     ~19
   24    23        CONCAT                                           ~20     'Inted+result%3A+', !4
         24        CONCAT                                           ~21     ~20, '%0A'
         25        ECHO                                                     ~21
         26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.31 ms | 1395 KiB | 17 Q