3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyException extends Exception { public function __construct( $message ) { parent::__construct( $message ); } } class Message { private $text; public function __construct( $text ) { $this->text = $text; } public function __toString() { return $this->text; } } echo (new MyException('blah'))->getMessage(); echo (new MyException( new Message('blah') ))->getMessage();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HUqRc
function name:  (null)
number of ops:  17
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   DECLARE_CLASS                                            'message'
   21     1        NEW                                              $0      'MyException'
          2        SEND_VAL_EX                                              'blah'
          3        DO_FCALL                                      0          
          4        INIT_METHOD_CALL                                         $0, 'getMessage'
          5        DO_FCALL                                      0  $2      
          6        ECHO                                                     $2
   23     7        NEW                                              $3      'MyException'
          8        NEW                                              $4      'Message'
          9        SEND_VAL_EX                                              'blah'
         10        DO_FCALL                                      0          
         11        SEND_VAR_NO_REF_EX                                       $4
         12        DO_FCALL                                      0          
         13        INIT_METHOD_CALL                                         $3, 'getMessage'
         14        DO_FCALL                                      0  $7      
         15        ECHO                                                     $7
         16      > RETURN                                                   1

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

End of function __construct

End of class MyException.

Class Message:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HUqRc
function name:  __construct
number of ops:  4
compiled vars:  !0 = $text
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   13     1        ASSIGN_OBJ                                               'text'
          2        OP_DATA                                                  !0
   14     3      > 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/HUqRc
function name:  __toString
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   FETCH_OBJ_R                                      ~0      'text'
          1        VERIFY_RETURN_TYPE                                       ~0
          2      > RETURN                                                   ~0
   18     3*       VERIFY_RETURN_TYPE                                       
          4*     > RETURN                                                   null

End of function __tostring

End of class Message.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.75 ms | 1000 KiB | 13 Q