3v4l.org

run code in 300+ PHP versions simultaneously
<?php $val = '12.2'; if (is_int($val)) { echo true; } else if (is_string($val)) { if (! ctype_digit($val) && (! ctype_digit(substr($val, 1)) || substr($val, 0, 1) != "-")) { echo false; } } else { echo (is_double($val) && floor($val) == $val); } echo true;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 5
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 40
Branch analysis from position: 40
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 32
Branch analysis from position: 7
2 jumps found. (Code = 46) Position 1 = 12, Position 2 = 29
Branch analysis from position: 12
2 jumps found. (Code = 47) Position 1 = 21, Position 2 = 28
Branch analysis from position: 21
2 jumps found. (Code = 43) Position 1 = 30, Position 2 = 31
Branch analysis from position: 30
1 jumps found. (Code = 42) Position 1 = 40
Branch analysis from position: 40
Branch analysis from position: 31
Branch analysis from position: 28
Branch analysis from position: 29
Branch analysis from position: 32
2 jumps found. (Code = 46) Position 1 = 34, Position 2 = 39
Branch analysis from position: 34
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 39
filename:       /in/fYopM
function name:  (null)
number of ops:  42
compiled vars:  !0 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '12.2'
    3     1        TYPE_CHECK                                   16          !0
          2      > JMPZ                                                     ~2, ->5
    4     3    >   ECHO                                                     <true>
          4      > JMP                                                      ->40
    5     5    >   TYPE_CHECK                                   64          !0
          6      > JMPZ                                                     ~3, ->32
    6     7    >   INIT_FCALL                                               'ctype_digit'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $4      
         10        BOOL_NOT                                         ~5      $4
         11      > JMPZ_EX                                          ~5      ~5, ->29
         12    >   INIT_FCALL                                               'ctype_digit'
         13        INIT_FCALL                                               'substr'
         14        SEND_VAR                                                 !0
         15        SEND_VAL                                                 1
         16        DO_ICALL                                         $6      
         17        SEND_VAR                                                 $6
         18        DO_ICALL                                         $7      
         19        BOOL_NOT                                         ~8      $7
         20      > JMPNZ_EX                                         ~8      ~8, ->28
         21    >   INIT_FCALL                                               'substr'
         22        SEND_VAR                                                 !0
         23        SEND_VAL                                                 0
         24        SEND_VAL                                                 1
         25        DO_ICALL                                         $9      
         26        IS_NOT_EQUAL                                     ~10     $9, '-'
         27        BOOL                                             ~8      ~10
         28    >   BOOL                                             ~5      ~8
         29    > > JMPZ                                                     ~5, ->31
    7    30    >   ECHO                                                     <false>
         31    > > JMP                                                      ->40
   10    32    >   TYPE_CHECK                                   32  ~11     !0
         33      > JMPZ_EX                                          ~11     ~11, ->39
         34    >   INIT_FCALL                                               'floor'
         35        SEND_VAR                                                 !0
         36        DO_ICALL                                         $12     
         37        IS_EQUAL                                         ~13     !0, $12
         38        BOOL                                             ~11     ~13
         39    >   ECHO                                                     ~11
   12    40    >   ECHO                                                     <true>
         41      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.33 ms | 1400 KiB | 19 Q