3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo{ public static $myvar = 99; public function __construct(){ $this->myvar = 35; } public function printMyVar(){ echo $this->myvar; } public function setMyVar($mv){ $this->myvar = $mv; } } echo foo::$myvar."\n"; $foo = new foo(); echo $foo->printMyVar(); echo "\n"; echo foo::$myvar."\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KGEen
function name:  (null)
number of ops:  14
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   FETCH_STATIC_PROP_R          unknown             ~1      'myvar'
          1        CONCAT                                           ~2      ~1, '%0A'
          2        ECHO                                                     ~2
   18     3        NEW                                              $3      'foo'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $3
   20     6        INIT_METHOD_CALL                                         !0, 'printMyVar'
          7        DO_FCALL                                      0  $6      
          8        ECHO                                                     $6
   21     9        ECHO                                                     '%0A'
   23    10        FETCH_STATIC_PROP_R          unknown             ~7      'myvar'
         11        CONCAT                                           ~8      ~7, '%0A'
         12        ECHO                                                     ~8
         13      > RETURN                                                   1

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

End of function __construct

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

End of function printmyvar

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

End of function setmyvar

End of class foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.7 ms | 1395 KiB | 13 Q