3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyException extends Exception { public function __construct($message, $code=0, Exception $previous = null) { parent::__construct($message,$code,this); } public function __toString() { return __CLASS__. ":[{$this->code}]:{$this->message}\n"; } } throw new MyException("Foo");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/kHAGC
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'myexception', 'exception'
   13     1        NEW                                              $0      'MyException'
          2        SEND_VAL_EX                                              'Foo'
          3        DO_FCALL                                      0          
          4      > THROW                                         0          $0
          5*     > RETURN                                                   1

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

End of function __construct

Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kHAGC
function name:  __toString
number of ops:  12
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ROPE_INIT                                     5  ~3      '%3A%5B'
          1        FETCH_OBJ_R                                      ~0      'code'
          2        ROPE_ADD                                      1  ~3      ~3, ~0
          3        ROPE_ADD                                      2  ~3      ~3, '%5D%3A'
          4        FETCH_OBJ_R                                      ~1      'message'
          5        ROPE_ADD                                      3  ~3      ~3, ~1
          6        ROPE_END                                      4  ~2      ~3, '%0A'
          7        CONCAT                                           ~6      'MyException', ~2
          8        VERIFY_RETURN_TYPE                                       ~6
          9      > RETURN                                                   ~6
   10    10*       VERIFY_RETURN_TYPE                                       
         11*     > RETURN                                                   null

End of function __tostring

End of class MyException.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.04 ms | 1386 KiB | 13 Q