3v4l.org

run code in 500+ PHP versions simultaneously
<?php function setPrevious(Throwable $e, Throwable $previous): Throwable { try { try { throw $previous; } finally { throw $e; } } catch (Throwable $e) { return $e; } } class SimpleException extends Exception { public function __construct($message) { parent::__construct($message); } } $a = new SimpleException('A'); $b = new SimpleException('B'); $c = new SimpleException('C'); setPrevious($a, $b); setPrevious($a, $c); $e = $a; do { var_dump($e->getMessage()); } while ($e = $e->getPrevious());
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 44) Position 1 = 30, Position 2 = 21
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
filename:       /in/BZUJr
function name:  (null)
number of ops:  31
compiled vars:  !0 = $a, !1 = $b, !2 = $c, !3 = $e
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   24     0  E >   NEW                                                  $4      'SimpleException'
          1        SEND_VAL_EX                                                  'A'
          2        DO_FCALL                                          0          
          3        ASSIGN                                                       !0, $4
   25     4        NEW                                                  $7      'SimpleException'
          5        SEND_VAL_EX                                                  'B'
          6        DO_FCALL                                          0          
          7        ASSIGN                                                       !1, $7
   26     8        NEW                                                  $10     'SimpleException'
          9        SEND_VAL_EX                                                  'C'
         10        DO_FCALL                                          0          
         11        ASSIGN                                                       !2, $10
   28    12        INIT_FCALL                                                   'setprevious'
         13        SEND_VAR                                                     !0
         14        SEND_VAR                                                     !1
         15        DO_FCALL                                          0          
   29    16        INIT_FCALL                                                   'setprevious'
         17        SEND_VAR                                                     !0
         18        SEND_VAR                                                     !2
         19        DO_FCALL                                          0          
   31    20        ASSIGN                                                       !3, !0
   33    21    >   INIT_FCALL                                                   'var_dump'
         22        INIT_METHOD_CALL                                             !3, 'getMessage'
         23        DO_FCALL                                          0  $16     
         24        SEND_VAR                                                     $16
         25        DO_ICALL                                                     
   34    26        INIT_METHOD_CALL                                             !3, 'getPrevious'
         27        DO_FCALL                                          0  $18     
         28        ASSIGN                                               ~19     !3, $18
         29      > JMPNZ                                                        ~19, ->21
         30    > > RETURN                                                       1

Function setprevious:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
Found catch point at position: 8
Branch analysis from position: 8
2 jumps found. (Code = 107) Position 1 = 9, Position 2 = -2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BZUJr
function name:  setPrevious
number of ops:  13
compiled vars:  !0 = $e, !1 = $previous
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
    7     2      > THROW                                             0          !1
    8     3*       FAST_CALL                                                    ->5
          4*       JMP                                                          ->7
    9     5*       THROW                                             0          !0
          6*       FAST_RET                                                     
          7*       JMP                                                          ->11
   11     8  E > > CATCH                                           last         'Throwable'
   12     9    >   VERIFY_RETURN_TYPE                                           !0
         10      > RETURN                                                       !0
   14    11*       VERIFY_RETURN_TYPE                                           
         12*     > RETURN                                                       null

End of function setprevious

Class SimpleException:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BZUJr
function name:  __construct
number of ops:  5
compiled vars:  !0 = $message
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   18     0  E >   RECV                                                 !0      
   20     1        INIT_STATIC_METHOD_CALL                                      
          2        SEND_VAR_EX                                                  !0
          3        DO_FCALL                                          0          
   21     4      > RETURN                                                       null

End of function __construct

End of class SimpleException.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
161.99 ms | 2143 KiB | 16 Q