3v4l.org

run code in 300+ PHP versions simultaneously
<?php class test { private static $_cpt = 0 ; public function __construct() { self::$_cpt ++; } public function compt() { 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/HhLAV
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 __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HhLAV
function name:  __construct
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   PRE_INC_STATIC_PROP                                      '_cpt'
    7     1      > RETURN                                                   null

End of function __construct

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

End of function compt

End of class test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.15 ms | 1394 KiB | 13 Q