3v4l.org

run code in 300+ PHP versions simultaneously
<?php class CbMan { public function fn(callable $cb) { echo $cb(); } } class Pippo { public function yah() { return "hello world"; } } $methods = ['yah']; $aa = function($instance, $methods) { return call_user_func($instance, $methods); }; $instance = new Pippo(); $cb = $aa($instance, $methods); $cbman = new CbMan(); $cbman->fn($cb);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/W1qpb
function name:  (null)
number of ops:  18
compiled vars:  !0 = $methods, !1 = $aa, !2 = $instance, !3 = $cb, !4 = $cbman
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   ASSIGN                                                   !0, <array>
   20     1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FW1qpb%3A20%240'
          2        ASSIGN                                                   !1, ~6
   23     3        NEW                                              $8      'Pippo'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !2, $8
   24     6        INIT_DYNAMIC_CALL                                        !1
          7        SEND_VAR_EX                                              !2
          8        SEND_VAR_EX                                              !0
          9        DO_FCALL                                      0  $11     
         10        ASSIGN                                                   !3, $11
   26    11        NEW                                              $13     'CbMan'
         12        DO_FCALL                                      0          
         13        ASSIGN                                                   !4, $13
   27    14        INIT_METHOD_CALL                                         !4, 'fn'
         15        SEND_VAR_EX                                              !3
         16        DO_FCALL                                      0          
         17      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FW1qpb%3A20%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/W1qpb
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $instance, !1 = $methods
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   21     2        INIT_USER_CALL                                1          'call_user_func', !0
          3        SEND_USER                                                !1
          4        DO_FCALL                                      0  $2      
          5      > RETURN                                                   $2
   22     6*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FW1qpb%3A20%240

Class CbMan:
Function fn:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/W1qpb
function name:  fn
number of ops:  5
compiled vars:  !0 = $cb
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        INIT_DYNAMIC_CALL                                        !0
          2        DO_FCALL                                      0  $1      
          3        ECHO                                                     $1
    7     4      > RETURN                                                   null

End of function fn

End of class CbMan.

Class Pippo:
Function yah:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/W1qpb
function name:  yah
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E > > RETURN                                                   'hello+world'
   16     1*     > RETURN                                                   null

End of function yah

End of class Pippo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
181 ms | 1399 KiB | 13 Q