3v4l.org

run code in 300+ PHP versions simultaneously
<?php $number = 17.48; $number = intval(($number*10))/10; echo $number; // x.0 if x.1,x.2,x.3 ; x.5 if x.4,x.5,x.6 ; x+1.0 if x.7,x.8,x.9 $whole = floor($number); //integer part $decimal = $whole - $number; // decimal part echo $decimal;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6b26v
function name:  (null)
number of ops:  14
compiled vars:  !0 = $number, !1 = $whole, !2 = $decimal
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 17.48
    3     1        MUL                                              ~4      !0, 10
          2        CAST                                          4  ~5      ~4
          3        DIV                                              ~6      ~5, 10
          4        ASSIGN                                                   !0, ~6
    4     5        ECHO                                                     !0
    6     6        INIT_FCALL                                               'floor'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $8      
          9        ASSIGN                                                   !1, $8
    7    10        SUB                                              ~10     !1, !0
         11        ASSIGN                                                   !2, ~10
    8    12        ECHO                                                     !2
         13      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.19 ms | 1385 KiB | 15 Q