3v4l.org

run code in 500+ PHP versions simultaneously
<?php function a(): int { return 1.0001; } function b($c): int { if (!is_int($c)) { throw new \Exception('not an int'); } return $c * 5; } var_dump(a(), b(a()));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jd7hM
function name:  (null)
number of ops:  12
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   15     0  E >   INIT_FCALL                                                   'var_dump'
          1        INIT_FCALL                                                   'a'
          2        DO_FCALL                                          0  $0      
          3        SEND_VAR                                                     $0
          4        INIT_FCALL                                                   'b'
          5        INIT_FCALL                                                   'a'
          6        DO_FCALL                                          0  $1      
          7        SEND_VAR                                                     $1
          8        DO_FCALL                                          0  $2      
          9        SEND_VAR                                                     $2
         10        DO_ICALL                                                     
         11      > RETURN                                                       1

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

End of function a

Function b:
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
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jd7hM
function name:  b
number of ops:  13
compiled vars:  !0 = $c
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E >   RECV                                                 !0      
    9     1        TYPE_CHECK                                       16  ~1      !0
          2        BOOL_NOT                                             ~2      ~1
          3      > JMPZ                                                         ~2, ->8
   10     4    >   NEW                                                  $3      'Exception'
          5        SEND_VAL_EX                                                  'not+an+int'
          6        DO_FCALL                                          0          
          7      > THROW                                             0          $3
   12     8    >   MUL                                                  ~5      !0, 5
          9        VERIFY_RETURN_TYPE                                           ~5
         10      > RETURN                                                       ~5
   13    11*       VERIFY_RETURN_TYPE                                           
         12*     > RETURN                                                       null

End of function b

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
160.41 ms | 1744 KiB | 16 Q