3v4l.org

run code in 300+ PHP versions simultaneously
<?php function sayhello ($x) { return function ($y) use ($x) { echo $x . ' ' . $y . "\n"; }; } sayhello("hello")("world");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dsmR8
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                               'sayhello'
          1        SEND_VAL                                                 'hello'
          2        DO_FCALL                                      0  $0      
          3        INIT_DYNAMIC_CALL                                        $0
          4        SEND_VAL_EX                                              'world'
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

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

End of function sayhello

Function %00%7Bclosure%7D%2Fin%2FdsmR8%3A4%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dsmR8
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $y, !1 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
    5     2        CONCAT                                           ~2      !1, '+'
          3        CONCAT                                           ~3      ~2, !0
          4        CONCAT                                           ~4      ~3, '%0A'
          5        ECHO                                                     ~4
    6     6      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FdsmR8%3A4%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.42 ms | 1398 KiB | 14 Q