3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private $bar; public function __construct($value) { $this->bar = $value; } public function debugBar(Foo $object) { echo $object->bar, "\n"; } } class Baz extends Foo { } $o1 = new Foo(1); $o2 = new Baz(2); $o1->debugBar($o2); $o1->debugBar($o1);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Y27Si
function name:  (null)
number of ops:  15
compiled vars:  !0 = $o1, !1 = $o2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   NEW                                              $2      'Foo'
          1        SEND_VAL_EX                                              1
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
   23     4        NEW                                              $5      'Baz'
          5        SEND_VAL_EX                                              2
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $5
   24     8        INIT_METHOD_CALL                                         !0, 'debugBar'
          9        SEND_VAR_EX                                              !1
         10        DO_FCALL                                      0          
   25    11        INIT_METHOD_CALL                                         !0, 'debugBar'
         12        SEND_VAR_EX                                              !0
         13        DO_FCALL                                      0          
         14      > RETURN                                                   1

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

End of function __construct

Function debugbar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Y27Si
function name:  debugBar
number of ops:  5
compiled vars:  !0 = $object
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   13     1        FETCH_OBJ_R                                      ~1      !0, 'bar'
          2        ECHO                                                     ~1
          3        ECHO                                                     '%0A'
   14     4      > RETURN                                                   null

End of function debugbar

End of class Foo.

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

End of function __construct

Function debugbar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Y27Si
function name:  debugBar
number of ops:  5
compiled vars:  !0 = $object
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   13     1        FETCH_OBJ_R                                      ~1      !0, 'bar'
          2        ECHO                                                     ~1
          3        ECHO                                                     '%0A'
   14     4      > RETURN                                                   null

End of function debugbar

End of class Baz.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.93 ms | 1399 KiB | 13 Q