3v4l.org

run code in 300+ PHP versions simultaneously
<?php class SimpleClass { public const COSNTANT = "costant value"; private $var = "a default value"; function __construct($var) { $this->var = $var; } public function getVar() { return $this->var; } public function setVar($var) { $this->var = $var; } public function toString() { echo $this->var; } } $test = new SimpleClass("test2"); $test->setVar("test"); $test->toString(); echo SimpleClass::CONSTANT;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rUDbI
function name:  (null)
number of ops:  12
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   NEW                                              $1      'SimpleClass'
          1        SEND_VAL_EX                                              'test2'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   25     4        INIT_METHOD_CALL                                         !0, 'setVar'
          5        SEND_VAL_EX                                              'test'
          6        DO_FCALL                                      0          
   26     7        INIT_METHOD_CALL                                         !0, 'toString'
          8        DO_FCALL                                      0          
   27     9        FETCH_CLASS_CONSTANT                             ~6      'SimpleClass', 'CONSTANT'
         10        ECHO                                                     ~6
         11      > RETURN                                                   1

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

End of function __construct

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

End of function getvar

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

End of function setvar

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

End of function tostring

End of class SimpleClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.17 ms | 1390 KiB | 13 Q