3v4l.org

run code in 300+ PHP versions simultaneously
<?php callback(function() { print "This is a anonymous function.<br />/n"; }); $msg = "Hello, everyone"; $callback = function () use ($msg) { print "This is a closure use string value, msg is: $msg. <br />/n"; }; $msg = "Hello, everybody"; callback($callback);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sIoYC
function name:  (null)
number of ops:  13
compiled vars:  !0 = $msg, !1 = $callback
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL_BY_NAME                                       'callback'
          1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FsIoYC%3A3%240'
    5     2        SEND_VAL_EX                                              ~2
          3        DO_FCALL                                      0          
    8     4        ASSIGN                                                   !0, 'Hello%2C+everyone'
    9     5        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FsIoYC%3A9%241'
          6        BIND_LEXICAL                                             ~5, !0
          7        ASSIGN                                                   !1, ~5
   12     8        ASSIGN                                                   !0, 'Hello%2C+everybody'
   13     9        INIT_FCALL_BY_NAME                                       'callback'
         10        SEND_VAR_EX                                              !1
         11        DO_FCALL                                      0          
         12      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FsIoYC%3A3%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sIoYC
function name:  {closure}
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ECHO                                                     'This+is+a+anonymous+function.%3Cbr+%2F%3E%2Fn'
    5     1      > RETURN                                                   null

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

Function %00%7Bclosure%7D%2Fin%2FsIoYC%3A9%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sIoYC
function name:  {closure}
number of ops:  6
compiled vars:  !0 = $msg
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   BIND_STATIC                                              !0
   10     1        ROPE_INIT                                     3  ~2      'This+is+a+closure+use+string+value%2C+msg+is%3A+'
          2        ROPE_ADD                                      1  ~2      ~2, !0
          3        ROPE_END                                      2  ~1      ~2, '.+%3Cbr+%2F%3E%2Fn'
          4        ECHO                                                     ~1
   11     5      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FsIoYC%3A9%241

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.78 ms | 1395 KiB | 13 Q