3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo { public static function bar() { static $baz= 0; return ++$baz; } } var_dump(foo::baz(), foo::baz());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0EWj7
function name:  (null)
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_STATIC_METHOD_CALL                                  'foo', 'baz'
          2        DO_FCALL                                      0  $0      
          3        SEND_VAR                                                 $0
          4        INIT_STATIC_METHOD_CALL                                  'foo', 'baz'
          5        DO_FCALL                                      0  $1      
          6        SEND_VAR                                                 $1
          7        DO_ICALL                                                 
          8      > RETURN                                                   1

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

End of function bar

End of class foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.08 ms | 1394 KiB | 15 Q