3v4l.org

run code in 300+ PHP versions simultaneously
<?php $exports = call_user_func(function(){ $fn = function($a, $b, $c, $this_ = NULL) { echo (string) gettype($this_); return "abc it's as easy as $a $b $c"; }; $fn_obj = (object) function($a, $b, $c) use(&$fn) { return call_user_func($fn, $a, $b, $c); }; $fn_obj->__call = function() { echo "CALL"; }; $fn_obj->call = function($this_, $a, $b, $c) use(&$fn) { return call_user_func($fn, $a, $b, $c, $this_); }; return $fn_obj; }); //$blah = $exports->call; //$blah(array(), 1,2,3); $exports->call(array(), 1,2,3);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1VUaT
function name:  (null)
number of ops:  11
compiled vars:  !0 = $exports
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F1VUaT%3A2%240'
   17     1        INIT_USER_CALL                                0          'call_user_func', ~1
          2        DO_FCALL                                      0  $2      
    2     3        ASSIGN                                                   !0, $2
   22     4        INIT_METHOD_CALL                                         !0, 'call'
          5        SEND_VAL_EX                                              <array>
          6        SEND_VAL_EX                                              1
          7        SEND_VAL_EX                                              2
          8        SEND_VAL_EX                                              3
          9        DO_FCALL                                      0          
         10      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F1VUaT%3A2%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1VUaT
function name:  {closure}
number of ops:  15
compiled vars:  !0 = $fn, !1 = $fn_obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F1VUaT%3A3%241'
          1        ASSIGN                                                   !0, ~2
    7     2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F1VUaT%3A7%242'
          3        BIND_LEXICAL                                             ~4, !0
    9     4        CAST                                          8  ~5      ~4
    7     5        ASSIGN                                                   !1, ~5
   10     6        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F1VUaT%3A10%243'
          7        ASSIGN_OBJ                                               !1, '__call'
   12     8        OP_DATA                                                  ~8
   13     9        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F1VUaT%3A13%244'
         10        BIND_LEXICAL                                             ~10, !0
         11        ASSIGN_OBJ                                               !1, 'call'
   15    12        OP_DATA                                                  ~10
   16    13      > RETURN                                                   !1
   17    14*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F1VUaT%3A2%240

Function %00%7Bclosure%7D%2Fin%2F1VUaT%3A3%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1VUaT
function name:  {closure}
number of ops:  15
compiled vars:  !0 = $a, !1 = $b, !2 = $c, !3 = $this_
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV_INIT                                        !3      null
    4     4        GET_TYPE                                         ~4      !3
          5        CAST                                          6  ~5      ~4
          6        ECHO                                                     ~5
    5     7        ROPE_INIT                                     6  ~7      'abc+it%27s+as+easy+as+'
          8        ROPE_ADD                                      1  ~7      ~7, !0
          9        ROPE_ADD                                      2  ~7      ~7, '+'
         10        ROPE_ADD                                      3  ~7      ~7, !1
         11        ROPE_ADD                                      4  ~7      ~7, '+'
         12        ROPE_END                                      5  ~6      ~7, !2
         13      > RETURN                                                   ~6
    6    14*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F1VUaT%3A3%241

Function %00%7Bclosure%7D%2Fin%2F1VUaT%3A7%242:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1VUaT
function name:  {closure}
number of ops:  11
compiled vars:  !0 = $a, !1 = $b, !2 = $c, !3 = $fn
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        BIND_STATIC                                              !3
    8     4        INIT_USER_CALL                                3          'call_user_func', !3
          5        SEND_USER                                                !0
          6        SEND_USER                                                !1
          7        SEND_USER                                                !2
          8        DO_FCALL                                      0  $4      
          9      > RETURN                                                   $4
    9    10*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F1VUaT%3A7%242

Function %00%7Bclosure%7D%2Fin%2F1VUaT%3A10%243:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1VUaT
function name:  {closure}
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   ECHO                                                     'CALL'
   12     1      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F1VUaT%3A10%243

Function %00%7Bclosure%7D%2Fin%2F1VUaT%3A13%244:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1VUaT
function name:  {closure}
number of ops:  13
compiled vars:  !0 = $this_, !1 = $a, !2 = $b, !3 = $c, !4 = $fn
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
          4        BIND_STATIC                                              !4
   14     5        INIT_USER_CALL                                4          'call_user_func', !4
          6        SEND_USER                                                !1
          7        SEND_USER                                                !2
          8        SEND_USER                                                !3
          9        SEND_USER                                                !0
         10        DO_FCALL                                      0  $5      
         11      > RETURN                                                   $5
   15    12*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F1VUaT%3A13%244

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.71 ms | 1403 KiB | 13 Q