3v4l.org

run code in 300+ PHP versions simultaneously
<?php class a { private static $s = 0; function getA(){ return self::$s; } function increaseA (){ self::$s++; } } $a1 = new a(); $a1->increaseA(); var_dump($a1->getA()); $a2 = new a(); var_dump($a2->getA()); $a2->increaseA(); var_dump($a1->getA(), $a2->getA());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EYFjn
function name:  (null)
number of ops:  29
compiled vars:  !0 = $a1, !1 = $a2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   NEW                                              $2      'a'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   14     3        INIT_METHOD_CALL                                         !0, 'increaseA'
          4        DO_FCALL                                      0          
   15     5        INIT_FCALL                                               'var_dump'
          6        INIT_METHOD_CALL                                         !0, 'getA'
          7        DO_FCALL                                      0  $6      
          8        SEND_VAR                                                 $6
          9        DO_ICALL                                                 
   16    10        NEW                                              $8      'a'
         11        DO_FCALL                                      0          
         12        ASSIGN                                                   !1, $8
   17    13        INIT_FCALL                                               'var_dump'
         14        INIT_METHOD_CALL                                         !1, 'getA'
         15        DO_FCALL                                      0  $11     
         16        SEND_VAR                                                 $11
         17        DO_ICALL                                                 
   18    18        INIT_METHOD_CALL                                         !1, 'increaseA'
         19        DO_FCALL                                      0          
   19    20        INIT_FCALL                                               'var_dump'
         21        INIT_METHOD_CALL                                         !0, 'getA'
         22        DO_FCALL                                      0  $14     
         23        SEND_VAR                                                 $14
         24        INIT_METHOD_CALL                                         !1, 'getA'
         25        DO_FCALL                                      0  $15     
         26        SEND_VAR                                                 $15
         27        DO_ICALL                                                 
         28      > RETURN                                                   1

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

End of function geta

Function increasea:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EYFjn
function name:  increaseA
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   PRE_INC_STATIC_PROP                                      's'
   10     1      > RETURN                                                   null

End of function increasea

End of class a.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.61 ms | 1396 KiB | 15 Q