3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo(int $integer): int { return $integer; } try { var_dump(foo(1)); } catch (TypeError $e) { echo "Exception! "; var_dump($e); } try { var_dump(foo("1")); } catch (TypeError $e) { echo "Exception! "; var_dump($e); } try { var_dump(foo("a")); } catch (TypeError $e) { echo "Exception! "; var_dump($e); } try { var_dump(foo("0x0F")); } catch (TypeError $e) { echo "Exception! "; var_dump($e); } try { var_dump(foo(0x0F)); } catch (TypeError $e) { echo "Exception! "; var_dump($e); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 36
Branch analysis from position: 36
1 jumps found. (Code = 42) Position 1 = 48
Branch analysis from position: 48
1 jumps found. (Code = 42) Position 1 = 60
Branch analysis from position: 60
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 7
Branch analysis from position: 7
2 jumps found. (Code = 107) Position 1 = 8, Position 2 = -2
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
Found catch point at position: 19
Branch analysis from position: 19
2 jumps found. (Code = 107) Position 1 = 20, Position 2 = -2
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 36
Branch analysis from position: 36
Found catch point at position: 31
Branch analysis from position: 31
2 jumps found. (Code = 107) Position 1 = 32, Position 2 = -2
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 48
Branch analysis from position: 48
Found catch point at position: 43
Branch analysis from position: 43
2 jumps found. (Code = 107) Position 1 = 44, Position 2 = -2
Branch analysis from position: 44
1 jumps found. (Code = 42) Position 1 = 60
Branch analysis from position: 60
Found catch point at position: 55
Branch analysis from position: 55
2 jumps found. (Code = 107) Position 1 = 56, Position 2 = -2
Branch analysis from position: 56
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/H28Ge
function name:  (null)
number of ops:  61
compiled vars:  !0 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'foo'
          2        SEND_VAL                                                 1
          3        DO_FCALL                                      0  $1      
          4        SEND_VAR                                                 $1
          5        DO_ICALL                                                 
          6      > JMP                                                      ->12
    8     7  E > > CATCH                                       last         'TypeError'
    9     8    >   ECHO                                                     'Exception%21+'
   10     9        INIT_FCALL                                               'var_dump'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                                 
   13    12    >   INIT_FCALL                                               'var_dump'
         13        INIT_FCALL                                               'foo'
         14        SEND_VAL                                                 '1'
         15        DO_FCALL                                      0  $4      
         16        SEND_VAR                                                 $4
         17        DO_ICALL                                                 
         18      > JMP                                                      ->24
   15    19  E > > CATCH                                       last         'TypeError'
   16    20    >   ECHO                                                     'Exception%21+'
   17    21        INIT_FCALL                                               'var_dump'
         22        SEND_VAR                                                 !0
         23        DO_ICALL                                                 
   20    24    >   INIT_FCALL                                               'var_dump'
         25        INIT_FCALL                                               'foo'
         26        SEND_VAL                                                 'a'
         27        DO_FCALL                                      0  $7      
         28        SEND_VAR                                                 $7
         29        DO_ICALL                                                 
         30      > JMP                                                      ->36
   22    31  E > > CATCH                                       last         'TypeError'
   23    32    >   ECHO                                                     'Exception%21+'
   24    33        INIT_FCALL                                               'var_dump'
         34        SEND_VAR                                                 !0
         35        DO_ICALL                                                 
   27    36    >   INIT_FCALL                                               'var_dump'
         37        INIT_FCALL                                               'foo'
         38        SEND_VAL                                                 '0x0F'
         39        DO_FCALL                                      0  $10     
         40        SEND_VAR                                                 $10
         41        DO_ICALL                                                 
         42      > JMP                                                      ->48
   29    43  E > > CATCH                                       last         'TypeError'
   30    44    >   ECHO                                                     'Exception%21+'
   31    45        INIT_FCALL                                               'var_dump'
         46        SEND_VAR                                                 !0
         47        DO_ICALL                                                 
   34    48    >   INIT_FCALL                                               'var_dump'
         49        INIT_FCALL                                               'foo'
         50        SEND_VAL                                                 15
         51        DO_FCALL                                      0  $13     
         52        SEND_VAR                                                 $13
         53        DO_ICALL                                                 
         54      > JMP                                                      ->60
   36    55  E > > CATCH                                       last         'TypeError'
   37    56    >   ECHO                                                     'Exception%21+'
   38    57        INIT_FCALL                                               'var_dump'
         58        SEND_VAR                                                 !0
         59        DO_ICALL                                                 
   39    60    > > RETURN                                                   1

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/H28Ge
function name:  foo
number of ops:  5
compiled vars:  !0 = $integer
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        VERIFY_RETURN_TYPE                                       !0
          2      > RETURN                                                   !0
          3*       VERIFY_RETURN_TYPE                                       
          4*     > RETURN                                                   null

End of function foo

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
196.36 ms | 1403 KiB | 20 Q