3v4l.org

run code in 300+ PHP versions simultaneously
<?php $zero = 0; // global scope $f1 = function() use ($zero) { $one = 1; // third-level closure scope of f4 $f2 = function() use ($zero, $one) { // $two = 2; // second-level closure scope of f4 // $f3 = function() use ($zero, $one, $two) { // $three = 3; // first-level closure scope of f4 // $f4 = function() use ($zero, $one, $two, $three) { // $four = 4; // local scope of f4 // echo $zero + $one + $two + $three + $four; // } // } }; }; $f4();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/t6Oc8
function name:  (null)
number of ops:  7
compiled vars:  !0 = $zero, !1 = $f1, !2 = $f4
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 0
    3     1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Ft6Oc8%3A3%240'
          2        BIND_LEXICAL                                             ~4, !0
          3        ASSIGN                                                   !1, ~4
   16     4        INIT_DYNAMIC_CALL                                        !2
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2Ft6Oc8%3A3%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/t6Oc8
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $zero, !1 = $one, !2 = $f2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   BIND_STATIC                                              !0
    4     1        ASSIGN                                                   !1, 1
    5     2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Ft6Oc8%3A5%241'
          3        BIND_LEXICAL                                             ~4, !0
          4        BIND_LEXICAL                                             ~4, !1
          5        ASSIGN                                                   !2, ~4
   15     6      > RETURN                                                   null

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

Function %00%7Bclosure%7D%2Fin%2Ft6Oc8%3A5%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/t6Oc8
function name:  {closure}
number of ops:  3
compiled vars:  !0 = $zero, !1 = $one
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   BIND_STATIC                                              !0
          1        BIND_STATIC                                              !1
   14     2      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Ft6Oc8%3A5%241

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.12 ms | 1394 KiB | 13 Q