I'am trying to write a function that includes any variable into a classs. For example:
My function: add_action($VARS_ARRAY);
This function should include $VARS_ARRAY into A class.
How can I do it in PHP?
you don't need a function for this, you can just add a value directly.
$a = new A();
$a->vars_array = $VARS_ARRAY;