3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { protected $foo; public function getFoo() { return $this->foo; } } class Bar extends Foo { public function __construct($foo) { $this->foo = $foo; } } class FooBar { public $test = 'Hello World!'; } $test = new FooBar(); $foo = new Foo($test); $bar = new Bar($test); var_dump($foo); echo "---\n"; var_dump($bar);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/S3DEt
function name:  (null)
number of ops:  19
compiled vars:  !0 = $test, !1 = $foo, !2 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   NEW                                              $3      'FooBar'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
   27     3        NEW                                              $6      'Foo'
          4        SEND_VAR_EX                                              !0
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !1, $6
   28     7        NEW                                              $9      'Bar'
          8        SEND_VAR_EX                                              !0
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !2, $9
   30    11        INIT_FCALL                                               'var_dump'
         12        SEND_VAR                                                 !1
         13        DO_ICALL                                                 
   31    14        ECHO                                                     '---%0A'
   32    15        INIT_FCALL                                               'var_dump'
         16        SEND_VAR                                                 !2
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

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

End of function getfoo

End of class Foo.

Class Bar:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/S3DEt
function name:  __construct
number of ops:  4
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
   17     1        ASSIGN_OBJ                                               'foo'
          2        OP_DATA                                                  !0
   18     3      > RETURN                                                   null

End of function __construct

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

End of function getfoo

End of class Bar.

Class FooBar: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.1 ms | 1388 KiB | 15 Q