3v4l.org

run code in 300+ PHP versions simultaneously
<?php class test { private static $_cpt = 0 ; public function compt() { self::$_cpt ++; return self::$_cpt; } } $insta1 = new test(); // Un $insta2 = new test(); // 2 $insta3 = new test(); // 2 $insta4 = new test(); // 2 echo test::compt();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/trad0
function name:  (null)
number of ops:  16
compiled vars:  !0 = $insta1, !1 = $insta2, !2 = $insta3, !3 = $insta4
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   NEW                                              $4      'test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $4
   15     3        NEW                                              $7      'test'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $7
   16     6        NEW                                              $10     'test'
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !2, $10
   17     9        NEW                                              $13     'test'
         10        DO_FCALL                                      0          
         11        ASSIGN                                                   !3, $13
   19    12        INIT_STATIC_METHOD_CALL                                  'test', 'compt'
         13        DO_FCALL                                      0  $16     
         14        ECHO                                                     $16
         15      > RETURN                                                   1

Class test:
Function compt:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/trad0
function name:  compt
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   PRE_INC_STATIC_PROP                                      '_cpt'
    8     1        FETCH_STATIC_PROP_R          unknown             ~1      '_cpt'
          2      > RETURN                                                   ~1
    9     3*     > RETURN                                                   null

End of function compt

End of class test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.52 ms | 1394 KiB | 13 Q