3v4l.org

run code in 300+ PHP versions simultaneously
<?php $variableGlobal = 30; class myClass{ public $classProperty; function __construct(&$globalVar){ $this->classProperty = &$globalVar; } function myFunction(){ $accessible = $this->classProperty; // do something interesting print "$accessible\n"; } } $thisClass = new myClass($variableGlobal); $thisClass->myFunction(); $GLOBALS["variableGlobal"] = 44; $thisClass->myFunction();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7bCcF
function name:  (null)
number of ops:  13
compiled vars:  !0 = $variableGlobal, !1 = $thisClass
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 30
   21     1        NEW                                              $3      'myClass'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $3
   22     5        INIT_METHOD_CALL                                         !1, 'myFunction'
          6        DO_FCALL                                      0          
   23     7        FETCH_W                      global              $7      'GLOBALS'
          8        ASSIGN_DIM                                               $7, 'variableGlobal'
          9        OP_DATA                                                  44
   24    10        INIT_METHOD_CALL                                         !1, 'myFunction'
         11        DO_FCALL                                      0          
         12      > RETURN                                                   1

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

End of function __construct

Function myfunction:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7bCcF
function name:  myFunction
number of ops:  6
compiled vars:  !0 = $accessible
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   FETCH_OBJ_R                                      ~1      'classProperty'
          1        ASSIGN                                                   !0, ~1
   16     2        NOP                                                      
          3        FAST_CONCAT                                      ~3      !0, '%0A'
          4        ECHO                                                     ~3
   17     5      > RETURN                                                   null

End of function myfunction

End of class myClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.08 ms | 1386 KiB | 13 Q