3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { function test($a, $b) { var_dump('A:' . $a); var_dump('B:' . $b); } } $a = new A; call_user_func_array([$a, 'test'], ['1', '2']); // this works call_user_func_array([$a, 'test'], ['b' => '2', 'a' => 1]); // this works too call_user_func_array([$a, 'test'], ['c' => 1, 'd' => 2]); // this deoesnt work since php8 since there are no parametes names c or d
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DAsGO
function name:  (null)
number of ops:  22
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   NEW                                              $1      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   12     3        INIT_ARRAY                                       ~4      !0
          4        ADD_ARRAY_ELEMENT                                ~4      'test'
          5        INIT_USER_CALL                                0          'call_user_func_array', ~4
          6        SEND_ARRAY                                               <array>
          7        CHECK_UNDEF_ARGS                                         
          8        DO_FCALL                                      1          
   13     9        INIT_ARRAY                                       ~6      !0
         10        ADD_ARRAY_ELEMENT                                ~6      'test'
         11        INIT_USER_CALL                                0          'call_user_func_array', ~6
         12        SEND_ARRAY                                               <array>
         13        CHECK_UNDEF_ARGS                                         
         14        DO_FCALL                                      1          
   14    15        INIT_ARRAY                                       ~8      !0
         16        ADD_ARRAY_ELEMENT                                ~8      'test'
         17        INIT_USER_CALL                                0          'call_user_func_array', ~8
         18        SEND_ARRAY                                               <array>
         19        CHECK_UNDEF_ARGS                                         
         20        DO_FCALL                                      1          
         21      > RETURN                                                   1

Class A:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DAsGO
function name:  test
number of ops:  11
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    5     2        INIT_FCALL                                               'var_dump'
          3        CONCAT                                           ~2      'A%3A', !0
          4        SEND_VAL                                                 ~2
          5        DO_ICALL                                                 
    6     6        INIT_FCALL                                               'var_dump'
          7        CONCAT                                           ~4      'B%3A', !1
          8        SEND_VAL                                                 ~4
          9        DO_ICALL                                                 
    7    10      > RETURN                                                   null

End of function test

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.15 ms | 1011 KiB | 14 Q