3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public function __construct($f) { $this->f = $f; } public function __invoke() { return call_user_func_array($this->f, func_get_args()); } } $a = new A('strtolower'); echo call_user_func_array($a, array('A'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0m86s
function name:  (null)
number of ops:  10
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $1      'A'
          1        SEND_VAL_EX                                              'strtolower'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   17     4        INIT_USER_CALL                                0          'call_user_func_array', !0
          5        SEND_ARRAY                                               <array>
          6        CHECK_UNDEF_ARGS                                         
          7        DO_FCALL                                      0  $4      
          8        ECHO                                                     $4
          9      > RETURN                                                   1

Class A:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0m86s
function name:  __construct
number of ops:  4
compiled vars:  !0 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    6     1        ASSIGN_OBJ                                               'f'
          2        OP_DATA                                                  !0
    7     3      > RETURN                                                   null

End of function __construct

Function __invoke:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0m86s
function name:  __invoke
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   FETCH_OBJ_R                                      ~0      'f'
          1        INIT_USER_CALL                                0          'call_user_func_array', ~0
          2        FUNC_GET_ARGS                                    ~1      
          3        SEND_ARRAY                                               ~1
          4        CHECK_UNDEF_ARGS                                         
          5        DO_FCALL                                      0  $2      
          6      > RETURN                                                   $2
   12     7*     > RETURN                                                   null

End of function __invoke

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
183.26 ms | 1394 KiB | 13 Q