3v4l.org

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

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

End of function testcallback

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

End of function %00%7Bclosure%7D%2Fin%2FeZoLk%3A9%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.45 ms | 1390 KiB | 14 Q