3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); function myLog(string $message): string { return $message; } function add(int $a, int $b): int { try { myLog($a + $b); } catch (BaseException $e) { echo "Fatal error caught: ".$e->getMessage(); } return $a + $b; } $result = add(1, 3); echo $result;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ib1S6
function name:  (null)
number of ops:  7
compiled vars:  !0 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   INIT_FCALL                                               'add'
          1        SEND_VAL                                                 1
          2        SEND_VAL                                                 3
          3        DO_FCALL                                      0  $1      
          4        ASSIGN                                                   !0, $1
   18     5        ECHO                                                     !0
          6      > RETURN                                                   1

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

End of function mylog

Function add:
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 = 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 = 62) Position 1 = -2
filename:       /in/ib1S6
function name:  add
number of ops:  17
compiled vars:  !0 = $a, !1 = $b, !2 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   10     2        INIT_FCALL                                               'mylog'
          3        ADD                                              ~3      !0, !1
          4        SEND_VAL                                                 ~3
          5        DO_FCALL                                      0          
          6      > JMP                                                      ->12
   11     7  E > > CATCH                                       last         'BaseException'
   12     8    >   INIT_METHOD_CALL                                         !2, 'getMessage'
          9        DO_FCALL                                      0  $5      
         10        CONCAT                                           ~6      'Fatal+error+caught%3A+', $5
         11        ECHO                                                     ~6
   14    12    >   ADD                                              ~7      !0, !1
         13        VERIFY_RETURN_TYPE                                       ~7
         14      > RETURN                                                   ~7
   15    15*       VERIFY_RETURN_TYPE                                       
         16*     > RETURN                                                   null

End of function add

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.36 ms | 1403 KiB | 15 Q