3v4l.org

run code in 300+ PHP versions simultaneously
<?php function local(){ $x = 0; return function(){ $x += 1; return $x; }; } echo local();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WZQoK
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_FCALL                                               'local'
          1        DO_FCALL                                      0  $0      
          2        ECHO                                                     $0
          3      > RETURN                                                   1

Function local:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WZQoK
function name:  local
number of ops:  4
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, 0
    6     1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FWZQoK%3A6%240'
    9     2      > RETURN                                                   ~2
   10     3*     > RETURN                                                   null

End of function local

Function %00%7Bclosure%7D%2Fin%2FWZQoK%3A6%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WZQoK
function name:  {closure}
number of ops:  3
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ASSIGN_OP                                     1          !0, 1
    8     1      > RETURN                                                   !0
    9     2*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FWZQoK%3A6%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.24 ms | 1397 KiB | 14 Q