3v4l.org

run code in 300+ PHP versions simultaneously
<?php class FooException extends Exception { public function __toString() { return "HAHA NOT WHAT YOU THOUGHT IT WAS!!"; } } class BarException extends FooException { public function __toString() { return Exception::__toString(); } } $a = new BarException(); var_dump($a->__toString());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jZB70
function name:  (null)
number of ops:  11
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'fooexception', 'exception'
   11     1        DECLARE_CLASS                                            'barexception', 'fooexception'
   19     2        NEW                                              $1      'BarException'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $1
   20     5        INIT_FCALL                                               'var_dump'
          6        INIT_METHOD_CALL                                         !0, '__toString'
          7        DO_FCALL                                      0  $4      
          8        SEND_VAR                                                 $4
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Class FooException:
Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jZB70
function name:  __toString
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E > > RETURN                                                   'HAHA+NOT+WHAT+YOU+THOUGHT+IT+WAS%21%21'
    8     1*       VERIFY_RETURN_TYPE                                       
          2*     > RETURN                                                   null

End of function __tostring

End of class FooException.

Class BarException:
Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jZB70
function name:  __toString
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_STATIC_METHOD_CALL                                  'Exception', '__toString'
          1        DO_FCALL                                      0  $0      
          2        VERIFY_RETURN_TYPE                                       $0
          3      > RETURN                                                   $0
   16     4*       VERIFY_RETURN_TYPE                                       
          5*     > RETURN                                                   null

End of function __tostring

End of class BarException.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.55 ms | 1395 KiB | 15 Q