3v4l.org

run code in 500+ PHP versions simultaneously
<?php $numericString = '1.1'; if (!is_numeric($numericString)) { throw new Exception('not numeric'); } if (ctype_digit((string) $numericString)) { var_dump('YES'); } else { var_dump('NO'); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 8
Branch analysis from position: 4
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 17
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1Qrlg
function name:  (null)
number of ops:  21
compiled vars:  !0 = $numericString
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, '1.1'
    4     1        FRAMELESS_ICALL_1                is_numeric          ~2      !0
          2        BOOL_NOT                                             ~3      ~2
          3      > JMPZ                                                         ~3, ->8
    5     4    >   NEW                                                  $4      'Exception'
          5        SEND_VAL_EX                                                  'not+numeric'
          6        DO_FCALL                                          0          
          7      > THROW                                             0          $4
    8     8    >   INIT_FCALL                                                   'ctype_digit'
          9        CAST                                              6  ~6      !0
         10        SEND_VAL                                                     ~6
         11        DO_ICALL                                             $7      
         12      > JMPZ                                                         $7, ->17
    9    13    >   INIT_FCALL                                                   'var_dump'
         14        SEND_VAL                                                     'YES'
         15        DO_ICALL                                                     
    8    16      > JMP                                                          ->20
   11    17    >   INIT_FCALL                                                   'var_dump'
         18        SEND_VAL                                                     'NO'
         19        DO_ICALL                                                     
   12    20    > > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
164.9 ms | 3298 KiB | 15 Q