3v4l.org

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

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

End of function z

End of class x.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.16 ms | 1395 KiB | 15 Q