3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo { static $objcount = 0; function __construct(){ self::$objcount++; } function test(){ echo 'success'; } static function static_test(){ var_dump($this); } } var_dump(foo::$objcount); $a = new foo(); var_dump(foo::$objcount); $b = new foo(); var_dump(foo::$objcount); $a->static_test();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fetgF
function name:  (null)
number of ops:  21
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   INIT_FCALL                                               'var_dump'
          1        FETCH_STATIC_PROP_R          global lock         ~2      'objcount'
          2        SEND_VAL                                                 ~2
          3        DO_ICALL                                                 
   20     4        NEW                                              $4      'foo'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !0, $4
   21     7        INIT_FCALL                                               'var_dump'
          8        FETCH_STATIC_PROP_R          unknown             ~7      'objcount'
          9        SEND_VAL                                                 ~7
         10        DO_ICALL                                                 
   22    11        NEW                                              $9      'foo'
         12        DO_FCALL                                      0          
         13        ASSIGN                                                   !1, $9
   23    14        INIT_FCALL                                               'var_dump'
         15        FETCH_STATIC_PROP_R          unknown             ~12     'objcount'
         16        SEND_VAL                                                 ~12
         17        DO_ICALL                                                 
   24    18        INIT_METHOD_CALL                                         !0, 'static_test'
         19        DO_FCALL                                      0          
         20      > RETURN                                                   1

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

End of function __construct

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

End of function test

Function static_test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fetgF
function name:  static_test
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_FCALL                                               'var_dump'
          1        FETCH_THIS                                       ~0      
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                                 
   16     4      > RETURN                                                   null

End of function static_test

End of class foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.65 ms | 1400 KiB | 15 Q