3v4l.org

run code in 300+ PHP versions simultaneously
<?php $unsafeUserInput = 'a'; if (filter_var($unsafeUserInput, FILTER_VALIDATE_INT)) { $safeFilteredInput = (int) $unsafeUserInput; } else { throw new \Exception('Provide input must be integer type...'); } var_dump($safeFilteredInput);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 9
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/smGn4
function name:  (null)
number of ops:  17
compiled vars:  !0 = $unsafeUserInput, !1 = $safeFilteredInput
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'a'
    5     1        INIT_FCALL                                               'filter_var'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 257
          4        DO_ICALL                                         $3      
          5      > JMPZ                                                     $3, ->9
    6     6    >   CAST                                          4  ~4      !0
          7        ASSIGN                                                   !1, ~4
    5     8      > JMP                                                      ->13
    8     9    >   NEW                                              $6      'Exception'
         10        SEND_VAL_EX                                              'Provide+input+must+be+integer+type...'
         11        DO_FCALL                                      0          
         12      > THROW                                         0          $6
   12    13    >   INIT_FCALL                                               'var_dump'
         14        SEND_VAR                                                 !1
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.21 ms | 998 KiB | 15 Q