3v4l.org

run code in 300+ PHP versions simultaneously
<?php class TestClass{ private $name; public function __construct($name){ $this->$name=$name; } public function changeName($name){ $this->name=$name; } public function displayName(){ echo $this->name; } } $testCls= new TestClass('Dmitry Fucintv'); $testCls->changeName=function($name){ $this->name='Other name'; }; call_user_func($testCls->changeName, 'Some name'); $testCls->displayName();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/evtgj
function name:  (null)
number of ops:  14
compiled vars:  !0 = $testCls
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   NEW                                              $1      'TestClass'
          1        SEND_VAL_EX                                              'Dmitry+Fucintv'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   17     4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fevtgj%3A17%240'
          5        ASSIGN_OBJ                                               !0, 'changeName'
   19     6        OP_DATA                                                  ~5
   20     7        FETCH_OBJ_R                                      ~6      !0, 'changeName'
          8        INIT_USER_CALL                                1          'call_user_func', ~6
          9        SEND_USER                                                'Some+name'
         10        DO_FCALL                                      0          
   21    11        INIT_METHOD_CALL                                         !0, 'displayName'
         12        DO_FCALL                                      0          
         13      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2Fevtgj%3A17%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/evtgj
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
   18     1        FETCH_THIS                                       $1      
          2        ASSIGN_OBJ                                               $1, 'name'
          3        OP_DATA                                                  'Other+name'
   19     4      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Fevtgj%3A17%240

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

End of function __construct

Function changename:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/evtgj
function name:  changeName
number of ops:  4
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
    9     1        ASSIGN_OBJ                                               'name'
          2        OP_DATA                                                  !0
   10     3      > RETURN                                                   null

End of function changename

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

End of function displayname

End of class TestClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.55 ms | 1399 KiB | 13 Q