3v4l.org

run code in 300+ PHP versions simultaneously
<?php class a { protected $name = "franz"; public function getName() { return $this->name; } public function setName($name) { $this->name = $name; } } class modify { public function __construct($a) { $a->setName('john'); } } $a = new a; print $a->getName(); $mod = new modify($a); print $a->getName();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fRjnP
function name:  (null)
number of ops:  14
compiled vars:  !0 = $a, !1 = $mod
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   NEW                                              $2      'a'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   25     3        INIT_METHOD_CALL                                         !0, 'getName'
          4        DO_FCALL                                      0  $5      
          5        ECHO                                                     $5
   27     6        NEW                                              $6      'modify'
          7        SEND_VAR_EX                                              !0
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !1, $6
   29    10        INIT_METHOD_CALL                                         !0, 'getName'
         11        DO_FCALL                                      0  $9      
         12        ECHO                                                     $9
         13      > RETURN                                                   1

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

End of function getname

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

End of function setname

End of class a.

Class modify:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fRjnP
function name:  __construct
number of ops:  5
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
   19     1        INIT_METHOD_CALL                                         !0, 'setName'
          2        SEND_VAL_EX                                              'john'
          3        DO_FCALL                                      0          
   20     4      > RETURN                                                   null

End of function __construct

End of class modify.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.28 ms | 1395 KiB | 13 Q