3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo($v = null) { static $c = 4; if ($v) $c = $v; return ++$c; } echo foo(); echo foo(25); echo foo(0); echo foo('abc'); echo foo();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tAsT9
function name:  (null)
number of ops:  19
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                               'foo'
          1        DO_FCALL                                      0  $0      
          2        ECHO                                                     $0
   10     3        INIT_FCALL                                               'foo'
          4        SEND_VAL                                                 25
          5        DO_FCALL                                      0  $1      
          6        ECHO                                                     $1
   11     7        INIT_FCALL                                               'foo'
          8        SEND_VAL                                                 0
          9        DO_FCALL                                      0  $2      
         10        ECHO                                                     $2
   12    11        INIT_FCALL                                               'foo'
         12        SEND_VAL                                                 'abc'
         13        DO_FCALL                                      0  $3      
         14        ECHO                                                     $3
   13    15        INIT_FCALL                                               'foo'
         16        DO_FCALL                                      0  $4      
         17        ECHO                                                     $4
         18      > RETURN                                                   1

Function foo:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 4
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
filename:       /in/tAsT9
function name:  foo
number of ops:  7
compiled vars:  !0 = $v, !1 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV_INIT                                        !0      null
    4     1        BIND_STATIC                                              !1
    5     2      > JMPZ                                                     !0, ->4
          3    >   ASSIGN                                                   !1, !0
    6     4    >   PRE_INC                                          ~3      !1
          5      > RETURN                                                   ~3
    7     6*     > RETURN                                                   null

End of function foo

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.85 ms | 1398 KiB | 18 Q