3v4l.org

run code in 300+ PHP versions simultaneously
<?php class dog { public $name = ''; public function setName($name) { $this->name = $name; } public function getName() { return $this->name; } } $rover = new dog(); $rover->setName('rover'); echo $rover->getName(); $rover = new dog(); $rover->name = 'rover'; echo $rover->name;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Meton
function name:  (null)
number of ops:  17
compiled vars:  !0 = $rover
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   NEW                                              $1      'dog'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   15     3        INIT_METHOD_CALL                                         !0, 'setName'
          4        SEND_VAL_EX                                              'rover'
          5        DO_FCALL                                      0          
   16     6        INIT_METHOD_CALL                                         !0, 'getName'
          7        DO_FCALL                                      0  $5      
          8        ECHO                                                     $5
   19     9        NEW                                              $6      'dog'
         10        DO_FCALL                                      0          
         11        ASSIGN                                                   !0, $6
   20    12        ASSIGN_OBJ                                               !0, 'name'
         13        OP_DATA                                                  'rover'
   21    14        FETCH_OBJ_R                                      ~10     !0, 'name'
         15        ECHO                                                     ~10
         16      > RETURN                                                   1

Class dog:
Function setname:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Meton
function name:  setName
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                                               'name'
          2        OP_DATA                                                  !0
    7     3      > RETURN                                                   null

End of function setname

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

End of function getname

End of class dog.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.15 ms | 1386 KiB | 13 Q