3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class AbstractFoo { public $bar; final public function __construct() { $this->bar = static::BAR; } } class FooBar extends AbstractFoo { const BAR = 'foobar'; } class Foo extends AbstractFoo { //const BAR = 'foobar'; } $fooBar = new FooBar(); var_dump($fooBar->bar); $foo = new Foo(); var_dump($foo->bar);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WH5Xl
function name:  (null)
number of ops:  15
compiled vars:  !0 = $fooBar, !1 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   NEW                                              $2      'FooBar'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   24     3        INIT_FCALL                                               'var_dump'
          4        FETCH_OBJ_R                                      ~5      !0, 'bar'
          5        SEND_VAL                                                 ~5
          6        DO_ICALL                                                 
   26     7        NEW                                              $7      'Foo'
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !1, $7
   27    10        INIT_FCALL                                               'var_dump'
         11        FETCH_OBJ_R                                      ~10     !1, 'bar'
         12        SEND_VAL                                                 ~10
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

Class AbstractFoo:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WH5Xl
function name:  __construct
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   FETCH_CLASS_CONSTANT                             ~1      'BAR'
          1        ASSIGN_OBJ                                               'bar'
          2        OP_DATA                                                  ~1
   10     3      > RETURN                                                   null

End of function __construct

End of class AbstractFoo.

Class FooBar:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WH5Xl
function name:  __construct
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   FETCH_CLASS_CONSTANT                             ~1      'BAR'
          1        ASSIGN_OBJ                                               'bar'
          2        OP_DATA                                                  ~1
   10     3      > RETURN                                                   null

End of function __construct

End of class FooBar.

Class Foo:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WH5Xl
function name:  __construct
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   FETCH_CLASS_CONSTANT                             ~1      'BAR'
          1        ASSIGN_OBJ                                               'bar'
          2        OP_DATA                                                  ~1
   10     3      > RETURN                                                   null

End of function __construct

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.17 ms | 1437 KiB | 14 Q