3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public function __construct() { throw new Exception("test"); } } class B extends A { public function __construct() { var_dump($this); try { parent::__construct(); } catch (Exception $e) { var_dump($this); } } } $b = new B;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cPrWP
function name:  (null)
number of ops:  4
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   NEW                                              $1      'B'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
          3      > RETURN                                                   1

Class A:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/cPrWP
function name:  __construct
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   NEW                                              $0      'Exception'
          1        SEND_VAL_EX                                              'test'
          2        DO_FCALL                                      0          
          3      > THROW                                         0          $0
    5     4*     > RETURN                                                   null

End of function __construct

End of class A.

Class B:
Function __construct:
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/cPrWP
function name:  __construct
number of ops:  13
compiled vars:  !0 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   INIT_FCALL                                               'var_dump'
          1        FETCH_THIS                                       ~1      
          2        SEND_VAL                                                 ~1
          3        DO_ICALL                                                 
   13     4        INIT_STATIC_METHOD_CALL                                  
          5        DO_FCALL                                      0          
          6      > JMP                                                      ->12
   14     7  E > > CATCH                                       last         'Exception'
   15     8    >   INIT_FCALL                                               'var_dump'
          9        FETCH_THIS                                       ~4      
         10        SEND_VAL                                                 ~4
         11        DO_ICALL                                                 
   17    12    > > RETURN                                                   null

End of function __construct

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.92 ms | 1396 KiB | 15 Q