3v4l.org

run code in 300+ PHP versions simultaneously
<?php function testCallback(\Closure $callback) { $callback('test'); } $data = "\n"; testCallback(function($msg) use ($data) { echo $msg . $data; } );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5B77t
function name:  (null)
number of ops:  7
compiled vars:  !0 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ASSIGN                                                   !0, '%0A'
    8     1        INIT_FCALL                                               'testcallback'
          2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F5B77t%3A8%240'
          3        BIND_LEXICAL                                             ~2, !0
          4        SEND_VAL                                                 ~2
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

Function testcallback:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5B77t
function name:  testCallback
number of ops:  5
compiled vars:  !0 = $callback
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_DYNAMIC_CALL                                        !0
          2        SEND_VAL_EX                                              'test'
          3        DO_FCALL                                      0          
    5     4      > RETURN                                                   null

End of function testcallback

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

End of function %00%7Bclosure%7D%2Fin%2F5B77t%3A8%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.24 ms | 1398 KiB | 14 Q