3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); function double(int $value) { return 2 * $value; } function coerceInt(string $value) : int { return (int)$value; } try{ $a = double(coerceInt("5")); var_dump($a); $a = double("5"); var_dump($a); } catch (Throwable $e) { var_dump($e); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 18
Branch analysis from position: 18
2 jumps found. (Code = 107) Position 1 = 19, Position 2 = -2
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Nr2lJ
function name:  (null)
number of ops:  23
compiled vars:  !0 = $a, !1 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_FCALL                                               'double'
          1        INIT_FCALL                                               'coerceint'
          2        SEND_VAL                                                 '5'
          3        DO_FCALL                                      0  $2      
          4        SEND_VAR                                                 $2
          5        DO_FCALL                                      0  $3      
          6        ASSIGN                                                   !0, $3
   15     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                                 
   16    10        INIT_FCALL                                               'double'
         11        SEND_VAL                                                 '5'
         12        DO_FCALL                                      0  $6      
         13        ASSIGN                                                   !0, $6
   17    14        INIT_FCALL                                               'var_dump'
         15        SEND_VAR                                                 !0
         16        DO_ICALL                                                 
         17      > JMP                                                      ->22
   18    18  E > > CATCH                                       last         'Throwable'
   19    19    >   INIT_FCALL                                               'var_dump'
         20        SEND_VAR                                                 !1
         21        DO_ICALL                                                 
   20    22    > > RETURN                                                   1

Function double:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Nr2lJ
function name:  double
number of ops:  4
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    6     1        MUL                                              ~1      !0, 2
          2      > RETURN                                                   ~1
    7     3*     > RETURN                                                   null

End of function double

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

End of function coerceint

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.9 ms | 1406 KiB | 19 Q