3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Foo { private $x = 1; public function check() { return $this->x; } } class Bar extends Foo { public $x = 2; } class Buz extends Foo { private $x = 3; public function check() { return $this->x; } } $n = new Bar; var_dump($n); $k = new Buz; var_dump($n->check()); var_dump($k->check());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KkTD2
function name:  (null)
number of ops:  20
compiled vars:  !0 = $n, !1 = $k
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   22     0  E >   NEW                                                  $2      'Bar'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $2
   23     3        INIT_FCALL                                                   'var_dump'
          4        SEND_VAR                                                     !0
          5        DO_ICALL                                                     
   24     6        NEW                                                  $6      'Buz'
          7        DO_FCALL                                          0          
          8        ASSIGN                                                       !1, $6
   25     9        INIT_FCALL                                                   'var_dump'
         10        INIT_METHOD_CALL                                             !0, 'check'
         11        DO_FCALL                                          0  $9      
         12        SEND_VAR                                                     $9
         13        DO_ICALL                                                     
   26    14        INIT_FCALL                                                   'var_dump'
         15        INIT_METHOD_CALL                                             !1, 'check'
         16        DO_FCALL                                          0  $11     
         17        SEND_VAR                                                     $11
         18        DO_ICALL                                                     
         19      > RETURN                                                       1

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

End of function check

End of class Foo.

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

End of function check

End of class Bar.

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

End of function check

End of class Buz.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
228 ms | 2558 KiB | 14 Q