3v4l.org

run code in 300+ PHP versions simultaneously
<?php class SimpleClass { const COSNTANT_VALUE = "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(); class MyClass { const CONST_VALUE = "A constant value"; private $name; function __construct() { } } $className = "MyClass"; echo $className::CONST_VALUE; echo MyClass::CONST_VALUE; echo SimpleClass::CONSTANT_VALUE;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QFViZ
function name:  (null)
number of ops:  17
compiled vars:  !0 = $test, !1 = $className
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   NEW                                              $2      'SimpleClass'
          1        SEND_VAL_EX                                              'test2'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
   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          
   38     9        ASSIGN                                                   !1, 'MyClass'
   39    10        FETCH_CLASS                                   0  $8      !1
         11        FETCH_CLASS_CONSTANT                             ~9      $8, 'CONST_VALUE'
         12        ECHO                                                     ~9
   40    13        ECHO                                                     'A+constant+value'
   41    14        FETCH_CLASS_CONSTANT                             ~10     'SimpleClass', 'CONSTANT_VALUE'
         15        ECHO                                                     ~10
         16      > RETURN                                                   1

Class SimpleClass:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QFViZ
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/QFViZ
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/QFViZ
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/QFViZ
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.

Class MyClass:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QFViZ
function name:  __construct
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   35     0  E > > RETURN                                                   null

End of function __construct

End of class MyClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.89 ms | 1390 KiB | 13 Q