3v4l.org

run code in 300+ PHP versions simultaneously
<?php class x { function test() { static $x = 0; return ++$x; } } $x = new x(); var_dump($x->test()); $y = new x(); var_dump($y->test());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/udnGI
function name:  (null)
number of ops:  17
compiled vars:  !0 = $x, !1 = $y
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   NEW                                              $2      'x'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   14     3        INIT_FCALL                                               'var_dump'
          4        INIT_METHOD_CALL                                         !0, 'test'
          5        DO_FCALL                                      0  $5      
          6        SEND_VAR                                                 $5
          7        DO_ICALL                                                 
   15     8        NEW                                              $7      'x'
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !1, $7
   16    11        INIT_FCALL                                               'var_dump'
         12        INIT_METHOD_CALL                                         !1, 'test'
         13        DO_FCALL                                      0  $10     
         14        SEND_VAR                                                 $10
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

Class x:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/udnGI
function name:  test
number of ops:  4
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   BIND_STATIC                                              !0
    9     1        PRE_INC                                          ~1      !0
          2      > RETURN                                                   ~1
   10     3*     > RETURN                                                   null

End of function test

End of class x.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.44 ms | 1395 KiB | 15 Q