3v4l.org

run code in 300+ PHP versions simultaneously
<?php $calc = function ($arg = null, $acc = '') use (&$calc) { return $arg === null ? $acc : function ($number = null) use (&$calc, $arg, $acc) { return $calc($number, $acc . $arg); }; }; $result = $calc(1)(3)(3)(7)(); var_dump($result); $result = $calc(2)(2)(8)(); var_dump($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZfIO0
function name:  (null)
number of ops:  37
compiled vars:  !0 = $calc, !1 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FZfIO0%3A3%240'
          1        BIND_LEXICAL                                             ~2, !0
          2        ASSIGN                                                   !0, ~2
    9     3        INIT_DYNAMIC_CALL                                        !0
          4        SEND_VAL_EX                                              1
          5        DO_FCALL                                      0  $4      
          6        INIT_DYNAMIC_CALL                                        $4
          7        SEND_VAL_EX                                              3
          8        DO_FCALL                                      0  $5      
          9        INIT_DYNAMIC_CALL                                        $5
         10        SEND_VAL_EX                                              3
         11        DO_FCALL                                      0  $6      
         12        INIT_DYNAMIC_CALL                                        $6
         13        SEND_VAL_EX                                              7
         14        DO_FCALL                                      0  $7      
         15        INIT_DYNAMIC_CALL                                        $7
         16        DO_FCALL                                      0  $8      
         17        ASSIGN                                                   !1, $8
   10    18        INIT_FCALL                                               'var_dump'
         19        SEND_VAR                                                 !1
         20        DO_ICALL                                                 
   11    21        INIT_DYNAMIC_CALL                                        !0
         22        SEND_VAL_EX                                              2
         23        DO_FCALL                                      0  $11     
         24        INIT_DYNAMIC_CALL                                        $11
         25        SEND_VAL_EX                                              2
         26        DO_FCALL                                      0  $12     
         27        INIT_DYNAMIC_CALL                                        $12
         28        SEND_VAL_EX                                              8
         29        DO_FCALL                                      0  $13     
         30        INIT_DYNAMIC_CALL                                        $13
         31        DO_FCALL                                      0  $14     
         32        ASSIGN                                                   !1, $14
   12    33        INIT_FCALL                                               'var_dump'
         34        SEND_VAR                                                 !1
         35        DO_ICALL                                                 
         36      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FZfIO0%3A3%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 7
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZfIO0
function name:  {closure}
number of ops:  14
compiled vars:  !0 = $arg, !1 = $acc, !2 = $calc
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV_INIT                                        !0      null
          1        RECV_INIT                                        !1      ''
          2        BIND_STATIC                                              !2
    4     3        TYPE_CHECK                                    2          !0
          4      > JMPZ                                                     ~3, ->7
          5    >   QM_ASSIGN                                        ~4      !1
          6      > JMP                                                      ->12
          7    >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FZfIO0%3A4%241'
          8        BIND_LEXICAL                                             ~5, !2
          9        BIND_LEXICAL                                             ~5, !0
         10        BIND_LEXICAL                                             ~5, !1
    6    11        QM_ASSIGN                                        ~4      ~5
         12    > > RETURN                                                   ~4
    7    13*     > RETURN                                                   null

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

Function %00%7Bclosure%7D%2Fin%2FZfIO0%3A4%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZfIO0
function name:  {closure}
number of ops:  11
compiled vars:  !0 = $number, !1 = $calc, !2 = $arg, !3 = $acc
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV_INIT                                        !0      null
          1        BIND_STATIC                                              !1
          2        BIND_STATIC                                              !2
          3        BIND_STATIC                                              !3
    5     4        INIT_DYNAMIC_CALL                                        !1
          5        SEND_VAR_EX                                              !0
          6        CONCAT                                           ~4      !3, !2
          7        SEND_VAL_EX                                              ~4
          8        DO_FCALL                                      0  $5      
          9      > RETURN                                                   $5
    6    10*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FZfIO0%3A4%241

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.9 ms | 1400 KiB | 15 Q