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; } } $foo = new Foo(new stdClass()); $$bar = new Bar(new stdClass()); var_dump($foo, $bar);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uOd2t
function name:  (null)
number of ops:  18
compiled vars:  !0 = $foo, !1 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   NEW                                              $2      'Foo'
          1        NEW                                              $3      'stdClass'
          2        DO_FCALL                                      0          
          3        SEND_VAR_NO_REF_EX                                       $3
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $2
   22     6        NEW                                              $8      'Bar'
          7        NEW                                              $9      'stdClass'
          8        DO_FCALL                                      0          
          9        SEND_VAR_NO_REF_EX                                       $9
         10        DO_FCALL                                      0          
         11        FETCH_W                      local               $7      !1
         12        ASSIGN                                                   $7, $8
   24    13        INIT_FCALL                                               'var_dump'
         14        SEND_VAR                                                 !0
         15        SEND_VAR                                                 !1
         16        DO_ICALL                                                 
         17      > RETURN                                                   1

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

End of function getfoo

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.91 ms | 1396 KiB | 15 Q