3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public static function bar() { $args = func_get_args(); var_dump($args); } } $input = new StdClass(); $input->method = array('Foo', 'bar'); $input->args = array(123, 456); call_user_func_array($input->method, $input->args); // NOT WORKING call_user_func_array($input->method, (array) $input->args); // NOT WORKING it just don't goes in the methods call call_user_func_array($input->method, array((array) $input->args)); // WORKING !!
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BGvdm
function name:  (null)
number of ops:  29
compiled vars:  !0 = $input
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   NEW                                              $1      'StdClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   14     3        ASSIGN_OBJ                                               !0, 'method'
          4        OP_DATA                                                  <array>
   15     5        ASSIGN_OBJ                                               !0, 'args'
          6        OP_DATA                                                  <array>
   19     7        FETCH_OBJ_R                                      ~6      !0, 'method'
          8        INIT_USER_CALL                                0          'call_user_func_array', ~6
          9        FETCH_OBJ_R                                      ~7      !0, 'args'
         10        SEND_ARRAY                                               ~7
         11        CHECK_UNDEF_ARGS                                         
         12        DO_FCALL                                      0          
   21    13        FETCH_OBJ_R                                      ~9      !0, 'method'
         14        INIT_USER_CALL                                0          'call_user_func_array', ~9
         15        FETCH_OBJ_R                                      ~10     !0, 'args'
         16        CAST                                          7  ~11     ~10
         17        SEND_ARRAY                                               ~11
         18        CHECK_UNDEF_ARGS                                         
         19        DO_FCALL                                      0          
   23    20        FETCH_OBJ_R                                      ~13     !0, 'method'
         21        INIT_USER_CALL                                0          'call_user_func_array', ~13
         22        FETCH_OBJ_R                                      ~14     !0, 'args'
         23        CAST                                          7  ~15     ~14
         24        INIT_ARRAY                                       ~16     ~15
         25        SEND_ARRAY                                               ~16
         26        CHECK_UNDEF_ARGS                                         
         27        DO_FCALL                                      0          
         28      > RETURN                                                   1

Class Foo:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BGvdm
function name:  bar
number of ops:  6
compiled vars:  !0 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   FUNC_GET_ARGS                                    ~1      
          1        ASSIGN                                                   !0, ~1
    7     2        INIT_FCALL                                               'var_dump'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                                 
    8     5      > RETURN                                                   null

End of function bar

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.43 ms | 1396 KiB | 15 Q