3v4l.org

run code in 500+ PHP versions simultaneously
<?php class A{ private $item = 5; public function getItem(){ return $this->item; } } $obj = new A(); echo $obj->getItem(); $obj->getItem = function(){return 10;}; echo $obj->getItem();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7YKZH
function name:  (null)
number of ops:  13
compiled vars:  !0 = $obj
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   12     0  E >   NEW                                                  $1      'A'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $1
   14     3        INIT_METHOD_CALL                                             !0, 'getItem'
          4        DO_FCALL                                          0  $4      
          5        ECHO                                                         $4
   16     6        DECLARE_LAMBDA_FUNCTION                              ~6      [0]
          7        ASSIGN_OBJ                                                   !0, 'getItem'
          8        OP_DATA                                                      ~6
   18     9        INIT_METHOD_CALL                                             !0, 'getItem'
         10        DO_FCALL                                          0  $7      
         11        ECHO                                                         $7
         12      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7YKZH
function name:  {closure:/in/7YKZH:16}
number of ops:  2
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   16     0  E > > RETURN                                                       10
          1*     > RETURN                                                       null

End of Dynamic Function 0

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

End of function getitem

End of class A.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
159.18 ms | 2522 KiB | 13 Q