3v4l.org

run code in 300+ PHP versions simultaneously
<?php function is_decimal( $val ) { return is_numeric( $val ) && floor( $val ) != $val; } var_dump(is_decimal(1)); var_dump(is_decimal(1.0)); var_dump(is_decimal(1.0000001));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9rvn1
function name:  (null)
number of ops:  19
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'is_decimal'
          2        SEND_VAL                                                 1
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
    7     6        INIT_FCALL                                               'var_dump'
          7        INIT_FCALL                                               'is_decimal'
          8        SEND_VAL                                                 1
          9        DO_FCALL                                      0  $2      
         10        SEND_VAR                                                 $2
         11        DO_ICALL                                                 
    8    12        INIT_FCALL                                               'var_dump'
         13        INIT_FCALL                                               'is_decimal'
         14        SEND_VAL                                                 1
         15        DO_FCALL                                      0  $4      
         16        SEND_VAR                                                 $4
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

Function is_decimal:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 5, Position 2 = 10
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
filename:       /in/9rvn1
function name:  is_decimal
number of ops:  12
compiled vars:  !0 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'is_numeric'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $1      
          4      > JMPZ_EX                                          ~2      $1, ->10
          5    >   INIT_FCALL                                               'floor'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $3      
          8        IS_NOT_EQUAL                                     ~4      !0, $3
          9        BOOL                                             ~2      ~4
         10    > > RETURN                                                   ~2
    5    11*     > RETURN                                                   null

End of function is_decimal

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.45 ms | 1399 KiB | 22 Q