3v4l.org

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

Function %00%7Bclosure%7D%2Fin%2FC50Xi%3A3%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/C50Xi
function name:  {closure}
number of ops:  4
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   BIND_STATIC                                              !0
    5     1        POST_INC                                         ~1      !0
          2      > RETURN                                                   ~1
    6     3*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FC50Xi%3A3%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.22 ms | 1395 KiB | 15 Q