3v4l.org

run code in 300+ PHP versions simultaneously
<?php class FooException extends Exception { public function __toString() { return Exception::__toString(); } } class Foo { public $prop = 'bar'; public function nonStatic() { return $this->prop; } } class Bar extends Foo { public function anotherNonStatic() { return Foo::nonStatic(); } } $a = new FooException(); var_dump($a->__toString()); $b = new Bar(); var_dump($b->anotherNonStatic());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WZf7d
function name:  (null)
number of ops:  18
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'fooexception', 'exception'
   22     1        NEW                                              $2      'FooException'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
   23     4        INIT_FCALL                                               'var_dump'
          5        INIT_METHOD_CALL                                         !0, '__toString'
          6        DO_FCALL                                      0  $5      
          7        SEND_VAR                                                 $5
          8        DO_ICALL                                                 
   24     9        NEW                                              $7      'Bar'
         10        DO_FCALL                                      0          
         11        ASSIGN                                                   !1, $7
   25    12        INIT_FCALL                                               'var_dump'
         13        INIT_METHOD_CALL                                         !1, 'anotherNonStatic'
         14        DO_FCALL                                      0  $10     
         15        SEND_VAR                                                 $10
         16        DO_ICALL                                                 
         17      > RETURN                                                   1

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

End of function __tostring

End of class FooException.

Class Foo:
Function nonstatic:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WZf7d
function name:  nonStatic
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   FETCH_OBJ_R                                      ~0      'prop'
          1      > RETURN                                                   ~0
          2*     > RETURN                                                   null

End of function nonstatic

End of class Foo.

Class Bar:
Function anothernonstatic:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WZf7d
function name:  anotherNonStatic
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   INIT_STATIC_METHOD_CALL                                  'Foo', 'nonStatic'
          1        DO_FCALL                                      0  $0      
          2      > RETURN                                                   $0
          3*     > RETURN                                                   null

End of function anothernonstatic

Function nonstatic:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WZf7d
function name:  nonStatic
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   FETCH_OBJ_R                                      ~0      'prop'
          1      > RETURN                                                   ~0
          2*     > RETURN                                                   null

End of function nonstatic

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.8 ms | 1400 KiB | 15 Q