3v4l.org

run code in 300+ PHP versions simultaneously
<?php $func = function () { static $val; if (!isset($val)) { $val = 0; } return ++$val; }; for ($i=0; $i<5; $i++) { var_dump($func()); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 4
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 4
Branch analysis from position: 12
Branch analysis from position: 4
filename:       /in/otIAQ
function name:  (null)
number of ops:  13
compiled vars:  !0 = $func, !1 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FotIAQ%3A2%240'
          1        ASSIGN                                                   !0, ~2
   11     2        ASSIGN                                                   !1, 0
          3      > JMP                                                      ->10
   13     4    >   INIT_FCALL                                               'var_dump'
          5        INIT_DYNAMIC_CALL                                        !0
          6        DO_FCALL                                      0  $5      
          7        SEND_VAR                                                 $5
          8        DO_ICALL                                                 
   11     9        PRE_INC                                                  !1
         10    >   IS_SMALLER                                               !1, 5
         11      > JMPNZ                                                    ~8, ->4
   14    12    > > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FotIAQ%3A2%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 5
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
filename:       /in/otIAQ
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   BIND_STATIC                                              !0
    4     1        ISSET_ISEMPTY_CV                                 ~1      !0
          2        BOOL_NOT                                         ~2      ~1
          3      > JMPZ                                                     ~2, ->5
    6     4    >   ASSIGN                                                   !0, 0
    8     5    >   PRE_INC                                          ~4      !0
          6      > RETURN                                                   ~4
    9     7*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FotIAQ%3A2%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.06 ms | 1395 KiB | 15 Q