3v4l.org

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

Class A:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9Fc9k
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:
172.38 ms | 1394 KiB | 13 Q