3v4l.org

run code in 300+ PHP versions simultaneously
<?php function a($a, $b) { return function ($e) use ($a, $b){ return "$e $a $b"; }; } $greet = function($name) { printf("Hello %s\r\n", $name); }; //var_dump(a('h','p')); //$s = a('h','p'); //echo $s('poop'); a('h','p')('poop');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QN3WQ
function name:  (null)
number of ops:  10
compiled vars:  !0 = $greet
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FQN3WQ%3A14%241'
          1        ASSIGN                                                   !0, ~1
   26     2        INIT_FCALL                                               'a'
          3        SEND_VAL                                                 'h'
          4        SEND_VAL                                                 'p'
          5        DO_FCALL                                      0  $3      
          6        INIT_DYNAMIC_CALL                                        $3
          7        SEND_VAL_EX                                              'poop'
          8        DO_FCALL                                      0          
          9      > RETURN                                                   1

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

End of function a

Function %00%7Bclosure%7D%2Fin%2FQN3WQ%3A5%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QN3WQ
function name:  {closure}
number of ops:  10
compiled vars:  !0 = $e, !1 = $a, !2 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
          2        BIND_STATIC                                              !2
    6     3        ROPE_INIT                                     5  ~4      !0
          4        ROPE_ADD                                      1  ~4      ~4, '+'
          5        ROPE_ADD                                      2  ~4      ~4, !1
          6        ROPE_ADD                                      3  ~4      ~4, '+'
          7        ROPE_END                                      4  ~3      ~4, !2
          8      > RETURN                                                   ~3
    7     9*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FQN3WQ%3A5%240

Function %00%7Bclosure%7D%2Fin%2FQN3WQ%3A14%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QN3WQ
function name:  {closure}
number of ops:  6
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
   16     1        INIT_FCALL                                               'printf'
          2        SEND_VAL                                                 'Hello+%25s%0D%0A'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                                 
   17     5      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FQN3WQ%3A14%241

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.64 ms | 1407 KiB | 16 Q