3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyClass { public $prop1 = "I'm a class property!"; public function setProperty($newval) { $this->prop1 = $newval; } public function getProperty() { return $this->prop1 . "<br/>"; } } $obj = new MyClass;// Class instantiation. //var_dump($obj); echo "1st drill:"."<br>"; echo $obj->getProperty(); //echo prop1 string (// Get the property value). $obj->setProperty('I am a new property value'."<br><br>"); echo $obj->getProperty(); // Read it out again to show the change. //Second Drill echo "second drill: "."<br>"; class class2 { public $obj2="I am the first variable from the second drill."; public function setProperty2($newval2) { $this->obj2=$newval2; } public function getProperty2($newval2) { return $this->obj2."<br>"; } } // Create two objects $obj = new class2; $obj2 = new class2;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VgRDX
function name:  (null)
number of ops:  21
compiled vars:  !0 = $obj, !1 = $obj2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $2      'MyClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   17     3        ECHO                                                     '1st+drill%3A%3Cbr%3E'
   18     4        INIT_METHOD_CALL                                         !0, 'getProperty'
          5        DO_FCALL                                      0  $5      
          6        ECHO                                                     $5
   19     7        INIT_METHOD_CALL                                         !0, 'setProperty'
          8        SEND_VAL_EX                                              'I+am+a+new+property+value%3Cbr%3E%3Cbr%3E'
          9        DO_FCALL                                      0          
   20    10        INIT_METHOD_CALL                                         !0, 'getProperty'
         11        DO_FCALL                                      0  $7      
         12        ECHO                                                     $7
   23    13        ECHO                                                     'second+drill%3A+%3Cbr%3E'
   37    14        NEW                                              $8      'class2'
         15        DO_FCALL                                      0          
         16        ASSIGN                                                   !0, $8
   38    17        NEW                                              $11     'class2'
         18        DO_FCALL                                      0          
         19        ASSIGN                                                   !1, $11
         20      > RETURN                                                   1

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

End of function setproperty

Function getproperty:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VgRDX
function name:  getProperty
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   FETCH_OBJ_R                                      ~0      'prop1'
          1        CONCAT                                           ~1      ~0, '%3Cbr%2F%3E'
          2      > RETURN                                                   ~1
   13     3*     > RETURN                                                   null

End of function getproperty

End of class MyClass.

Class class2:
Function setproperty2:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VgRDX
function name:  setProperty2
number of ops:  4
compiled vars:  !0 = $newval2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   RECV                                             !0      
   28     1        ASSIGN_OBJ                                               'obj2'
          2        OP_DATA                                                  !0
   29     3      > RETURN                                                   null

End of function setproperty2

Function getproperty2:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VgRDX
function name:  getProperty2
number of ops:  5
compiled vars:  !0 = $newval2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E >   RECV                                             !0      
   33     1        FETCH_OBJ_R                                      ~1      'obj2'
          2        CONCAT                                           ~2      ~1, '%3Cbr%3E'
          3      > RETURN                                                   ~2
   34     4*     > RETURN                                                   null

End of function getproperty2

End of class class2.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.54 ms | 1399 KiB | 13 Q