3v4l.org

run code in 300+ PHP versions simultaneously
<?php $sum = function($l) { return function($r) use ($l) { return $l + $r; }; }; echo $sum(4)(2);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mZHt3
function name:  (null)
number of ops:  10
compiled vars:  !0 = $sum
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FmZHt3%3A2%240'
          1        ASSIGN                                                   !0, ~1
    9     2        INIT_DYNAMIC_CALL                                        !0
          3        SEND_VAL_EX                                              4
          4        DO_FCALL                                      0  $3      
          5        INIT_DYNAMIC_CALL                                        $3
          6        SEND_VAL_EX                                              2
          7        DO_FCALL                                      0  $4      
          8        ECHO                                                     $4
          9      > RETURN                                                   1

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

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

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

End of function %00%7Bclosure%7D%2Fin%2FmZHt3%3A3%241

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.33 ms | 1398 KiB | 13 Q