3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyException extends Exception { public function __construct($message, $code=0) { if (version_compare(PHP_VERSION, '5.3.0') >= 0) { $previous = func_get_arg(2); parent::__construct($message,$code,$previous); } else { parent::__construct($message,$code); } } 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/XQHo4
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'
   20     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
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 18
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XQHo4
function name:  __construct
number of ops:  23
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
    7     2        INIT_FCALL                                               'version_compare'
          3        SEND_VAL                                                 '8.0.0'
          4        SEND_VAL                                                 '5.3.0'
          5        DO_ICALL                                         $3      
          6        IS_SMALLER_OR_EQUAL                                      0, $3
          7      > JMPZ                                                     ~4, ->18
    8     8    >   INIT_FCALL                                               'func_get_arg'
          9        SEND_VAL                                                 2
         10        DO_ICALL                                         $5      
         11        ASSIGN                                                   !2, $5
    9    12        INIT_STATIC_METHOD_CALL                                  
         13        SEND_VAR_EX                                              !0
         14        SEND_VAR_EX                                              !1
         15        SEND_VAR_EX                                              !2
         16        DO_FCALL                                      0          
         17      > JMP                                                      ->22
   12    18    >   INIT_STATIC_METHOD_CALL                                  
         19        SEND_VAR_EX                                              !0
         20        SEND_VAR_EX                                              !1
         21        DO_FCALL                                      0          
   14    22    > > 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/XQHo4
function name:  __toString
number of ops:  12
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     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
   17    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:
182.69 ms | 1405 KiB | 17 Q