3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { protected $bar = []; public function doBar() { $this->bar[] = 'barring'; } } class Bar extends Foo { public function getBar() { $this->doBar(); return $this->bar; } } $bar = new Bar(); var_dump($bar->getBar());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8rZb7
function name:  (null)
number of ops:  9
compiled vars:  !0 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   NEW                                              $1      'Bar'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   24     3        INIT_FCALL                                               'var_dump'
          4        INIT_METHOD_CALL                                         !0, 'getBar'
          5        DO_FCALL                                      0  $4      
          6        SEND_VAR                                                 $4
          7        DO_ICALL                                                 
          8      > RETURN                                                   1

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

End of function dobar

End of class Foo.

Class Bar:
Function getbar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8rZb7
function name:  getBar
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   INIT_METHOD_CALL                                         'doBar'
          1        DO_FCALL                                      0          
   19     2        FETCH_OBJ_R                                      ~1      'bar'
          3      > RETURN                                                   ~1
   20     4*     > RETURN                                                   null

End of function getbar

Function dobar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8rZb7
function name:  doBar
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   FETCH_OBJ_W                                      $0      'bar'
          1        ASSIGN_DIM                                               $0
          2        OP_DATA                                                  'barring'
   10     3      > RETURN                                                   null

End of function dobar

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.9 ms | 1396 KiB | 15 Q