3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyClass { public $prop1 = "I'm a class property!"; public function __construct() { echo 'The class "', __CLASS__, '" was initiated!<br />'; } public function __destruct() { echo 'The class "', __CLASS__, '" was destroyed.<br />'; } public function __toString() { echo "Using the toString method: "; return $this->getProperty(); } public function setProperty($newval) { $this->prop1 = $newval; } public function getProperty() { return $this->prop1 . "<br />"; } } // Create a new object $obj = new MyClass; // Output the object as a string echo $obj; // Destroy the object unset($obj); // Output a message at the end of the file echo "End of file.<br />"; ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8kad4
function name:  (null)
number of ops:  8
compiled vars:  !0 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'myclass'
   35     1        NEW                                              $1      'MyClass'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   38     4        ECHO                                                     !0
   41     5        UNSET_CV                                                 !0
   44     6        ECHO                                                     'End+of+file.%3Cbr+%2F%3E'
   46     7      > RETURN                                                   1

Class MyClass:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8kad4
function name:  __construct
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ECHO                                                     'The+class+%22'
          1        ECHO                                                     'MyClass'
          2        ECHO                                                     '%22+was+initiated%21%3Cbr+%2F%3E'
   10     3      > RETURN                                                   null

End of function __construct

Function __destruct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8kad4
function name:  __destruct
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   ECHO                                                     'The+class+%22'
          1        ECHO                                                     'MyClass'
          2        ECHO                                                     '%22+was+destroyed.%3Cbr+%2F%3E'
   15     3      > RETURN                                                   null

End of function __destruct

Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8kad4
function name:  __toString
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   ECHO                                                     'Using+the+toString+method%3A+'
   20     1        INIT_METHOD_CALL                                         'getProperty'
          2        DO_FCALL                                      0  $0      
          3        VERIFY_RETURN_TYPE                                       $0
          4      > RETURN                                                   $0
   21     5*       VERIFY_RETURN_TYPE                                       
          6*     > RETURN                                                   null

End of function __tostring

Function setproperty:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8kad4
function name:  setProperty
number of ops:  4
compiled vars:  !0 = $newval
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   RECV                                             !0      
   25     1        ASSIGN_OBJ                                               'prop1'
          2        OP_DATA                                                  !0
   26     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/8kad4
function name:  getProperty
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   FETCH_OBJ_R                                      ~0      'prop1'
          1        CONCAT                                           ~1      ~0, '%3Cbr+%2F%3E'
          2      > RETURN                                                   ~1
   31     3*     > RETURN                                                   null

End of function getproperty

End of class MyClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.39 ms | 1399 KiB | 13 Q