3v4l.org

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

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

End of function __construct

End of class MyException.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.42 ms | 1399 KiB | 15 Q