3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyParent { private $var1 = 0; } class Child extends MyParent { public function __construct() { $this->var1 = 1; } } class Abuser extends MyParent { public function get(MyParent $child) { return $child->var1; } } $child = new Child(); $abuser = new Abuser(); var_dump($abuser->get($child));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/td9BY
function name:  (null)
number of ops:  13
compiled vars:  !0 = $child, !1 = $abuser
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   NEW                                              $2      'Child'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   25     3        NEW                                              $5      'Abuser'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $5
   27     6        INIT_FCALL                                               'var_dump'
          7        INIT_METHOD_CALL                                         !1, 'get'
          8        SEND_VAR_EX                                              !0
          9        DO_FCALL                                      0  $8      
         10        SEND_VAR                                                 $8
         11        DO_ICALL                                                 
         12      > RETURN                                                   1

Class MyParent: [no user functions]
Class Child:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/td9BY
function name:  __construct
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   ASSIGN_OBJ                                               'var1'
          1        OP_DATA                                                  1
   13     2      > RETURN                                                   null

End of function __construct

End of class Child.

Class Abuser:
Function get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/td9BY
function name:  get
number of ops:  4
compiled vars:  !0 = $child
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   RECV                                             !0      
   20     1        FETCH_OBJ_R                                      ~1      !0, 'var1'
          2      > RETURN                                                   ~1
   21     3*     > RETURN                                                   null

End of function get

End of class Abuser.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.09 ms | 1395 KiB | 15 Q