3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Foo { function x(&$form, &$form_state) { $form = array('hi'); } } $foo = new Foo(); $callback = array($foo, 'x'); if (!empty($callback) && is_callable($callback)) { $result = call_user_func_array($callback, array(&$form, &$form_state)); } print_r($form);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 9, Position 2 = 13
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 21
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
Branch analysis from position: 13
filename:       /in/smvcH
function name:  (null)
number of ops:  25
compiled vars:  !0 = $foo, !1 = $callback, !2 = $result, !3 = $form, !4 = $form_state
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    9     0  E >   NEW                                                  $5      'Foo'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $5
   11     3        INIT_ARRAY                                           ~8      !0
          4        ADD_ARRAY_ELEMENT                                    ~8      'x'
          5        ASSIGN                                                       !1, ~8
   13     6        ISSET_ISEMPTY_CV                                     ~10     !1
          7        BOOL_NOT                                             ~11     ~10
          8      > JMPZ_EX                                              ~11     ~11, ->13
          9    >   INIT_FCALL                                                   'is_callable'
         10        SEND_VAR                                                     !1
         11        DO_ICALL                                             $12     
         12        BOOL                                                 ~11     $12
         13    > > JMPZ                                                         ~11, ->21
   14    14    >   INIT_USER_CALL                                    0          'call_user_func_array', !1
         15        INIT_ARRAY                                           ~13     !3
         16        ADD_ARRAY_ELEMENT                                    ~13     !4
         17        SEND_ARRAY                                                   ~13
         18        CHECK_UNDEF_ARGS                                             
         19        DO_FCALL                                          1  $14     
         20        ASSIGN                                                       !2, $14
   17    21    >   INIT_FCALL                                                   'print_r'
         22        SEND_VAR                                                     !3
         23        DO_ICALL                                                     
         24      > RETURN                                                       1

Class Foo:
Function x:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/smvcH
function name:  x
number of ops:  4
compiled vars:  !0 = $form, !1 = $form_state
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
    5     2        ASSIGN                                                       !0, <array>
    6     3      > RETURN                                                       null

End of function x

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
151.72 ms | 2344 KiB | 10 Q