3v4l.org

run code in 500+ PHP versions simultaneously
<?php Class abc{ // create a class public static $a; static function getsize() { return ++self::$a; //increment a static variable } static function setsize($n) { self::$a = $n; // set size of static variable } } abc::setsize(100); // set value of static variable echo abc::getsize(); //call getsize function output is 100 but it must be 101
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hV4hh
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   12     0  E >   INIT_STATIC_METHOD_CALL                                      'abc', 'setsize'
          1        SEND_VAL                                                     100
          2        DO_FCALL                                          0          
   13     3        INIT_STATIC_METHOD_CALL                                      'abc', 'getsize'
          4        DO_FCALL                                          0  $1      
          5        ECHO                                                         $1
          6      > RETURN                                                       1

Class abc:
Function getsize:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hV4hh
function name:  getsize
number of ops:  3
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    6     0  E >   PRE_INC_STATIC_PROP                                  ~0      'a'
          1      > RETURN                                                       ~0
    7     2*     > RETURN                                                       null

End of function getsize

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

End of function setsize

End of class abc.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
173.21 ms | 2512 KiB | 13 Q