3v4l.org

run code in 500+ PHP versions simultaneously
<?php class P { protected $v = 1; } class C extends P { public function test(P $i) { echo $i->v; } } class C2 extends P { public function __construct() { $this->v = 2; } } $c = new C; $c2 = new C2; $c->test($c2);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rL8pX
function name:  (null)
number of ops:  10
compiled vars:  !0 = $c, !1 = $c2
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   18     0  E >   NEW                                                  $2      'C'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $2
   19     3        NEW                                                  $5      'C2'
          4        DO_FCALL                                          0          
          5        ASSIGN                                                       !1, $5
   20     6        INIT_METHOD_CALL                                             !0, 'test'
          7        SEND_VAR_EX                                                  !1
          8        DO_FCALL                                          0          
          9      > RETURN                                                       1

Class P: [no user functions]
Class C:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rL8pX
function name:  test
number of ops:  4
compiled vars:  !0 = $i
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E >   RECV                                                 !0      
    8     1        FETCH_OBJ_R                                          ~1      !0, 'v'
          2        ECHO                                                         ~1
    9     3      > RETURN                                                       null

End of function test

End of class C.

Class C2:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rL8pX
function name:  __construct
number of ops:  3
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   14     0  E >   ASSIGN_OBJ                                                   'v'
          1        OP_DATA                                                      2
   15     2      > RETURN                                                       null

End of function __construct

End of class C2.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
169.32 ms | 1440 KiB | 13 Q