3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public function myEcho($property) { echo $this->{$property} . PHP_EOL; } } class B extends A { private $private; protected $protected; public function set($property, $value) { $this->{$property} = $value; } } $b = new B(); $b->set('protected', 'test protected'); $b->myEcho('protected'); $b->set('private', 'test private'); $b->myEcho('private');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XoSoI
function name:  (null)
number of ops:  18
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   NEW                                              $1      'B'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   25     3        INIT_METHOD_CALL                                         !0, 'set'
          4        SEND_VAL_EX                                              'protected'
          5        SEND_VAL_EX                                              'test+protected'
          6        DO_FCALL                                      0          
   26     7        INIT_METHOD_CALL                                         !0, 'myEcho'
          8        SEND_VAL_EX                                              'protected'
          9        DO_FCALL                                      0          
   28    10        INIT_METHOD_CALL                                         !0, 'set'
         11        SEND_VAL_EX                                              'private'
         12        SEND_VAL_EX                                              'test+private'
         13        DO_FCALL                                      0          
   29    14        INIT_METHOD_CALL                                         !0, 'myEcho'
         15        SEND_VAL_EX                                              'private'
         16        DO_FCALL                                      0          
         17      > RETURN                                                   1

Class A:
Function myecho:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XoSoI
function name:  myEcho
number of ops:  5
compiled vars:  !0 = $property
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    8     1        FETCH_OBJ_R                                      ~1      !0
          2        CONCAT                                           ~2      ~1, '%0A'
          3        ECHO                                                     ~2
    9     4      > RETURN                                                   null

End of function myecho

End of class A.

Class B:
Function set:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XoSoI
function name:  set
number of ops:  5
compiled vars:  !0 = $property, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   19     2        ASSIGN_OBJ                                               !0
          3        OP_DATA                                                  !1
   20     4      > RETURN                                                   null

End of function set

Function myecho:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XoSoI
function name:  myEcho
number of ops:  5
compiled vars:  !0 = $property
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    8     1        FETCH_OBJ_R                                      ~1      !0
          2        CONCAT                                           ~2      ~1, '%0A'
          3        ECHO                                                     ~2
    9     4      > RETURN                                                   null

End of function myecho

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.64 ms | 1399 KiB | 13 Q