3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A{ static function foo() { static $numCalls = 0; $numCalls++; print("this function has been executed " . $numCalls . " times<br>"); } } A->foo(); A->foo(); A->foo();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gamiC
function name:  (null)
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   FETCH_CONSTANT                                   ~0      'A'
          1        INIT_METHOD_CALL                                         ~0, 'foo'
          2        DO_FCALL                                      0          
   19     3        FETCH_CONSTANT                                   ~2      'A'
          4        INIT_METHOD_CALL                                         ~2, 'foo'
          5        DO_FCALL                                      0          
   23     6        FETCH_CONSTANT                                   ~4      'A'
          7        INIT_METHOD_CALL                                         ~4, 'foo'
          8        DO_FCALL                                      0          
          9      > RETURN                                                   1

Class A:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gamiC
function name:  foo
number of ops:  6
compiled vars:  !0 = $numCalls
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   BIND_STATIC                                              !0
    6     1        PRE_INC                                                  !0
    7     2        CONCAT                                           ~2      'this+function+has+been+executed+', !0
          3        CONCAT                                           ~3      ~2, '+times%3Cbr%3E'
          4        ECHO                                                     ~3
    8     5      > RETURN                                                   null

End of function foo

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.98 ms | 1393 KiB | 13 Q