3v4l.org

run code in 300+ PHP versions simultaneously
<?php function bar() { echo "bar() called\n"; return 1; } function foo() { static $i = bar(); echo $i++, "\n"; } foo(); foo(); foo();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bAFd9
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL                                               'foo'
          1        DO_FCALL                                      0          
   14     2        INIT_FCALL                                               'foo'
          3        DO_FCALL                                      0          
   15     4        INIT_FCALL                                               'foo'
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bAFd9
function name:  bar
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ECHO                                                     'bar%28%29+called%0A'
    5     1      > RETURN                                                   1
    6     2*     > RETURN                                                   null

End of function bar

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bAFd9
function name:  foo
number of ops:  8
compiled vars:  !0 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ZEND_BIND_INIT_STATIC_OR_JMP                             !0
          1        INIT_FCALL                                               'bar'
          2        DO_FCALL                                      0  $1      
          3        BIND_STATIC                                              !0, $1
   10     4        POST_INC                                         ~2      !0
          5        ECHO                                                     ~2
          6        ECHO                                                     '%0A'
   11     7      > RETURN                                                   null

End of function foo

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
136.99 ms | 998 KiB | 17 Q