3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Ex extends Exception { protected $code; public function __construct($message, $code) { $this->code = $code; parent::__construct($message); } } try { throw new Exception('aaa', 'aaa'); } catch (Exception $e) { var_dump($e->getCode()); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
Found catch point at position: 6
Branch analysis from position: 6
2 jumps found. (Code = 107) Position 1 = 7, Position 2 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QWre3
function name:  (null)
number of ops:  13
compiled vars:  !0 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   NEW                                              $1      'Exception'
          1        SEND_VAL_EX                                              'aaa'
          2        SEND_VAL_EX                                              'aaa'
          3        DO_FCALL                                      0          
          4      > THROW                                         0          $1
          5*       JMP                                                      ->12
   15     6  E > > CATCH                                       last         'Exception'
   16     7    >   INIT_FCALL                                               'var_dump'
          8        INIT_METHOD_CALL                                         !0, 'getCode'
          9        DO_FCALL                                      0  $3      
         10        SEND_VAR                                                 $3
         11        DO_ICALL                                                 
   17    12      > RETURN                                                   1

Class Ex:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QWre3
function name:  __construct
number of ops:  8
compiled vars:  !0 = $message, !1 = $code
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    6     2        ASSIGN_OBJ                                               'code'
          3        OP_DATA                                                  !1
    7     4        INIT_STATIC_METHOD_CALL                                  
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
    8     7      > RETURN                                                   null

End of function __construct

End of class Ex.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.04 ms | 1395 KiB | 15 Q