3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class C { private $s; public function __construct($s) { $this->s = $s; } protected function getS() { return $this->s; } } class C1 extends C { public function __get($name) { return 'wanted'.$name; } public function __construct($s1) { parent::__construct($s1); } function doStuff() { echo $this->getS(); echo $this->s; } } $c1 = new C1('foo'); $c1->doStuff();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kdGgX
function name:  (null)
number of ops:  7
compiled vars:  !0 = $c1
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   NEW                                              $1      'C1'
          1        SEND_VAL_EX                                              'foo'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   27     4        INIT_METHOD_CALL                                         !0, 'doStuff'
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

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

End of function __construct

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

End of function gets

End of class C.

Class C1:
Function __get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kdGgX
function name:  __get
number of ops:  4
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
   15     1        CONCAT                                           ~1      'wanted', !0
          2      > RETURN                                                   ~1
   16     3*     > RETURN                                                   null

End of function __get

Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kdGgX
function name:  __construct
number of ops:  5
compiled vars:  !0 = $s1
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
   18     1        INIT_STATIC_METHOD_CALL                                  
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
   19     4      > RETURN                                                   null

End of function __construct

Function dostuff:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kdGgX
function name:  doStuff
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   INIT_METHOD_CALL                                         'getS'
          1        DO_FCALL                                      0  $0      
          2        ECHO                                                     $0
   22     3        FETCH_OBJ_R                                      ~1      's'
          4        ECHO                                                     ~1
   23     5      > RETURN                                                   null

End of function dostuff

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

End of function gets

End of class C1.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
187.46 ms | 1403 KiB | 13 Q